You can execute your unit tests with or without collecting coverage information by running one of the VSTest built-in configurations. VSTest is an execution engine that can execute NUnit, MSTest, and xUnit tests. As a result, it allows you to execute tests from projects that use different testing frameworks in a single run. For example, if your Visual Studio solution contains two projects that use two different testing frameworks, NUnit and MSTest, you can run the tests in both projects in one run.
VSTest uses framework-specific test adapters to find and execute tests. If the tested scope includes multiple projects that use the same testing framework, ensure that the version of the adapter for this framework is consistent across all the projects.
Run one of the following built-in test configurations on the scope of analysis to execute your tests with VSTest:
Run VSTest Tests
- executes unit tests in the tested scopeRun VSTest Tests with Coverage
- executes unit tests in the tested scope, and collects coverage informationSee Configuring Test Configurations for details about specifying a test configuration.
|
Your command line may resemble the following:
Running tests without collecting coverage information
dottestcli.exe -solution "C:\Devel\FooSolution\FooSolution.sln" -config "builtin://Run VSTest Tests" -report "C:\Report" |
Running tests and collecting coverage information
dottestcli.exe -solution "C:\Devel\FooSolution\FooSolution.sln" -config "builtin://Run VSTest Tests with Coverage" -report "C:\Report" |
We strongly recommend that you execute your NUnit and MSTest test with the VSTest test configurations. The framework-specific test configurations are shipped with dotTEST for legacy purposes. |