Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test are being shown under "External" category in Test Explorer when Grouped By Project

Whenever I try to run tests on Test Explorer from Visual Studio 2012, SOME test are being categorized as "External", even though the Group By is set as "Group By Project" enter image description here

Then the source code is not recognized

like image 551
Jorge Alvarado Avatar asked Oct 31 '13 09:10

Jorge Alvarado


2 Answers

This is due the pdb file is not included in the compilation. If you're compiling in a solution configuration other than debug you must ensure that pdb is included.

To achieve that you must open the advanced build setting:

  • Right click on project and select properties
  • Click on build tab
  • Check that your configuration is selected in the "Configuration" dropdown
  • Click on advanced button.

In the new window you must select "pdb-only" in the debug info dropdown.

like image 141
Carlos Fernández Avatar answered Nov 14 '22 12:11

Carlos Fernández


This was happening for me but only when the combined length of the namespace, class, and test method exceeded 254 chars. (MS-Test, Visual Studio 2013 12.0.40629.00 Update 5)

namespace MyTests.HaveLong.Complicated.NamespaceAsWell.AsMuchAs.EightyFive.Chars.IfThatMatters
{
    [TestClass]
    public class A_Long_ClassName_MayAlso_Contribute_ToThe_Issue_ThisOneIs_EightyFive_Characters_Long
    {
        [TestMethod]
        public async Task This_IsAMsTest_TestMethod_WithAnEightyFive_CharacterName_WhichWillShow_UnderExternal()
        {
        }
        [TestMethod]
        public async Task This_IsAMsTest_TestMethod_WithAnEightyFour_CharacterName_WhichWontShowUnderExternal()
        {
        }
    }
}
like image 39
inchbuie Avatar answered Nov 14 '22 10:11

inchbuie