I have a solution written in VB.NET, including 2 test projects with over 3000 tests. The solution was migrated over from VS10 to VS12 to VS15 for now. I wanted to start with one test project to switch from "the old" MSTest (Microsoft.VisualStudio.QualityTools.UnitTestFramework) to MSTest V2 (Microsoft.VisualStudio.TestPlatform.TestFramework) to be able to use Row Tests and the ability to place the TestCategory attribute at class or assembly level.
By changing one project to target MSTest V2 I saw the followng things:
- the attributes I placed at class level are not discoverd by Resharper TestExplorer, though they are by VS TestExplorer (grouping in both by categories.)
- after the rebuild all tests are discovered as uncategorized
- openeing a file that is categorized at class level and changing the grouping to Project and Namespaces and back to Categories updates the test explorer and displays the, but only the opened file(s) as correctly categorized
- when openeing a file where the category is placed at the method definition I do not have to change the grouping in test explorer. The tests in that file are immediately corretly displayed in test explorer, but also only when opened
(- reference to another issue that also occurs during this actions
-> after rebuild it happens frequently, that not all tests are discovered by resharper as mentioned here (
RSRP-462731 Test runner not recognizing MSTest tests), but the refresh button is a workarouond for that most of the times)
I created a little sample solution with two test projects. One targeting MSTestV1, the other MSTestV2. The solution was created in VS 2015. I used the "Add new item" dialog and added the Unit test Project template from that. For the MSTestV2 Project, I removed the reference to the TestFramework V1, added the V2 and the Testadapter with Nuget and last added the proper references to the project.
The V2 project includes two TestClasses in separate files, one with the TestCategory-attribute (named "IntegrationTest") at class level, the othe has none.
If you now "rebuild all" the first time Resharper TestExplorer Shows everything correct.
Now remove the Attribute,
rebuild,
R# test explorer does not update.
Change "Group by:" to anything else and back,
everything is fine.