Including and excluding subset of tests for live execution
In this section, we will show you how to selectively include and/or exclude subset of tests from live unit test execution. This features is extremely helpful in improving responsiveness for very large solutions where building the entire solution and then executing all the unit tests could be time consuming and resource intensive.
Getting started
You will need to have the Visual Studio 2017 Enterprise edition installed on your machine to execute this recipe. You can install a licensed enterprise edition from https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Enterprise&rel=15.
How to do it...
- Open Visual Studio 2017 and create a C# solution with 10
ClassLibrary
projects, sayClassLibrary
,ClassLibrary1
, ...,ClassLibrary9
and one unit test projectUnitTestProject
:
- Add a project reference to all the class library projects in
UnitTestProject
. - Add a new test class
UnitTest2
inUnitTestProject
and rename the test method...