One of the visual changes that dotCover makes in the Visual Studio editor is the interactive marks for unit tests and unit tests classes on the left margin of the editor window. You can use these marks to instantly calculate the coverage of a particular unit test or unit test class.
It is obvious that a single test or a test class will not cover a large percentage of the solution code. You may rather use these coverage results to check how well the test covers the target code blocks.
- Open a file that contains unit tests in the Visual Studio text editor.
- Choose a test class or a test method.
- Click the corresponding mark in the left gutter.
In the context menu, choose
Cover with dotCover:
- dotCover will open the Unit Test Sessions window, execute the selected test or test class, and analyze its coverage.
- The resulted coverage snapshot will be displayed in the new Coverage area where you can analyze it.
There are two other alternatives for running coverage analysis of selected tests:
- You can run coverage analysis for selected unit tests in the Unit Test Sessions and Unit Test Explorer windows by choosing a test in the unit test tree and clicking Cover Unit Tests with dotCover on the toolbar.
- You can run coverage analysis for one of the covering tests by selecting a test in the navigation pop-up and clicking Cover Tests .
- Configuring dotCover
- Execution and Coverage Analysis of Unit Tests
- Recognizing Unit Tests
- Working with Unit Tests
- Sharing Unit Test Support with ReSharper
- Coverage of Unit Test Session
- Coverage of Unit Tests in Solution Part
- Coverage of Unit Tests in the Whole Solution