Coverage Analysis of Unit Tests
dotCover helps discover as well as run, debug or cover unit tests right in Visual Studio or using the command-line utility. The following unit testing frameworks are supported:
NUnit — dotCover installation includes two bundled test runners that support NUnit versions up to 2.7.1 and up to 3.15.5 respectively. NUnit versions up to 5.0 are also supported and are used if the corresponding NuGet package is installed in the project.
MSTest for all supported Visual Studio versions, including MSTest 4
xUnit v1, v2, and v3, including xUnit v3 version 4.0.
Custom test frameworks that use VSTest. To configure discovery for these frameworks, refer to VSTest.
Custom test frameworks that use Microsoft.Testing.Platform, such as TUnit.
Microsoft.Testing.Platform support is enabled by default. Build the test project to discover its tests. To configure this support, refer to Testing Platform.
To analyze coverage of Testing Platform tests, the test project also needs a dotCover NuGet package. For more information, refer to Analyze coverage of Testing Platform tests.
Machine.Specifications (requires an extension).
With dotCover, you can execute a single unit test, all tests in a test class, file, project or solution. You can also execute any number of tests combined in a test session.
Analyzing code coverage of unit tests in Visual Studio is one of the major usage scenarios for dotCover. It allows developers and test engineers to quickly locate parts of code not covered with unit tests and adjust their testing activities accordingly.
Before running coverage analysis , make sure that the PDB information exists for all target assemblies. The safest choice would be to build your code with the Debug build configuration.
In this section:
- In current document
- In project or solution
- Unit test sessions
- Test categories
- Execute tests
- Analyze test results
- Analyze coverage of Testing Platform tests
- Unit Test Explorer window
- Unit Test Sessions window
- Continuous Testing