dotCover Help

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

  1. Open a file that contains unit tests in the Visual Studio text editor.
  2. Choose a test class or a test method.
  3. Click the corresponding mark in the left gutter.
  4. In the context menu, choose Cover with dotCover:
    unit_test_cover_with_dotCover
  5. dotCover will open the Unit Test Sessions window, execute the selected test or test class, and analyze its coverage.
  6. 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 uts_toolbar_cover 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 uts_toolbar_cover.

See Also

Last modified: 27 May 2015