Question

NCover has an attribute IgnoreFromCoverage that allows for code to be marked for exclusion during code coverage analysis. Is there a way to do this with the VSTS Code Coverage Tools?

Obvious uses for this would be auto property getters and setters, non obvious uses may be code generated by R# equals implementation or ORM generated code.

Was it helpful?

Solution

For Visual Studio 2010 you can use the ExcludeFromCodeCoverage attribute. You can apply the attribute to an entire class or to methods within a class. See MSDN for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top