NCover Documentation

Please visit NCover Run for updated information.

Even though NCover.Reporting.exe lets you set satisfactory coverage percentages for any element, sometimes enforcing those percentages can be difficult. It's too easy for coverage to slip below a satisfactory level without anyone noticing until it's time to release the product.

To address this problem, NCover.Reporting.exe supports Minimum Coverage Thresholds that let you specify a minimum acceptable coverage for your project or for any part of it. If an element's coverage is below that minimum acceptable coverage percentage, NCover.Reporting.exe will display the element and exit with error code '3', which will make your build fail. For instructions on how to use Minimum Coverage Thresholds, read this article.

The screenshot below shows what NCover.Reporting.exe prints to the console when an element fails a minimum coverage threshold. In this case, the project failed a threshold that required 90% Symbol Coverage, and a class called ClassLoaded failed a threshold that required a maximum cyclomatic complexity of 1.

As you can see in the screenshot, NCover.Reporting.exe returned an exit code of 3, instead of the normal exit code of 0 that means it ran without any errors.

In addition to failing your build through NCover.Reporting.exe, options for checking minimum coverage thresholds are available in the tasks for MSBuild and NAnt.

If you still need technical assistance, we can help:

Submit A Support Ticket

Try NCover Free Contact Us Online