This article is based on Visual Studio 2017 Version 15.7 Preview 2. Although it’s nice to get a glimpse of good things to come, keep in mind that it’s not production-ready yet and that things may change.
With the current version of Visual Studio 2017, which is 15.6.5, you have to have really good naming to be able to look at Test Explorer and figure out what your tests actually do:
That’s because the tests are grouped based on their outcome, i.e. whether they’ve passed, failed, or not run at all.
But that’s going to change in Visual Studio 2017, where Test Explorer groups tests based on the more logical hierarchy of project, namespace, class and method:
This is also very handy because you can run a certain group of tests (e.g. tests in a specific class, or tests in a specific namespace), directly from Test Explorer, rather than having to do this by right-clicking the test code and using the context menu (which isn’t very intuitive for newer developers).
This is a small but significant improvement towards making Test Explorer more usable. It is also yet another change that brings Visual Studio closer to ReShaper in terms of functionality.
You can change the method of grouping with the drop-down at the top of the test explorer window. Also by decorating you test methods with a TestCategory attribute, you can add your own custom groupings.
Thanks for your comment – I admit I was not aware of the grouping options already available today. However, I see that they are limited to a single level (e.g. if you group by project, you’ll see all the tests for each project listed under it, with no nested groupings). The revamped Test Explorer is better organised in a multilevel hierarchy.