.netunit-testingvisual-studio-2012

organizing unit tests in groups in visual studio test explorer


I have a solution with about 70 projects in visual studio. The solution also contains several unit test projects. Visual studio displays my tests in the test explorer as following:

Run | Run ... |
> Passed tests
v Failed tests
* test1
* test2
> Not run tests

all tests are thrown together, and the only way i can think of organizing this screen is using a naming convention for the tests.

I would like to avoid that. Is there any way where i can organize the tests into a group or node?


Solution

  • You can use Traits to group your tests. With Traits, you can for example, group by Category or Priority and run only these tests.