dotCover 2019.1 Help

Coverage Results Filters

dotCover applies these filters to coverage results after a coverage session is over. Use these filters to:

  • Exclude nodes (namespaces, classes, and so on) you're currently not interested in from the coverage tree.

  • Exclude an entire file from the coverage tree. For example, this may be helpful if you want to exclude some auto-generated files (i.e. classes and methods declared in these files) from the results.

Excluding nodes from coverage results

To exclude a node (namespace, class, class member) from coverage results

  1. Open coverage results either in the Coverage Results Browser window or Unit Test Coverage window.

  2. Select a node and in the context menu choose:

    • Exclude from Coverage Results to exclude the node from the current results.

    • Exclude and Create Runtime Coverage Filter to exclude the node from the results and create a corresponding runtime filter that will prevent collecting coverage data for this node in future coverage sessions.

    • Exclude All But This to leave only the selected node in the coverage tree.

    dotcover getting started3

To show the excluded nodes back

Excluding files from coverage results

To exclude a file from coverage results

  1. Open filtering settings using the main menu ReSharper | Options... | dotCover | Filtering.

  2. Find the Exclude file masks list.

  3. Click Add to add a new exclude filter. Note that filters support ?, *, and ** wildcards. For example, to exclude all .cs files that have NUnit in their path and end with .generated, use **\*NUnit*\**\*.generated.cs.

Last modified: 7 May 2019

See Also