ExcludeFromCodeCoverage Attribute

Sometimes it happens that code coverage results are quite low because you use code generated (and therefore not tested or very little in your application), or code made by other developers, etc. Unfortunately the result of code coverage does not really match what it should be. To overcome this problem, you would like to be able to exclude certain classes of code coverage. Now this is possible with the ExcludeFromCodeCoverage (System.Diagnostics.CodeAnalysis) attribute. This attribute can be applied to any type of object.

For more information about this attribute: http://msdn.microsoft.com/en-us/library/dd984116(VS.100).aspx

Leave a reply