Coverage of Selected Unit Tests
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.
To run coverage analysis for selected unit test or test class
- 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 .