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: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/dd984116(v=vs.100)
Do you have a question or a suggestion about this post? Contact me!