If you are a user of NCover you know it has great power and that it can generate great results. But what do you do if you do not want to include certain items in your coverage report? In particular what do you do if you have generated code (say WCF Proxy code) which you do not want to skew your coverage numbers?
Simple, you exclude them right :)
If you are simply using the NCover Explorer this is easy, you can right click the namespace/type and say exclude. But what if you are using NCover from the command line? Well this is also simple.
All you need to do is use the excludeAttributes option for NCover.
The code above is what we use to generate our NCover reports, the important part is how we are using excludeAttributes. Now I know you are saying, wait you have a property being called, I want to see the ‘real’ value. Well it is below
excludeAttributes=”System.CodeDom.Compiler.GeneratedCodeAttribute”
Adding the code above will tell NCover to exclude any code with the above attribute (which should be good for WCF Proxies).
Till next time,
Posted
02-11-2010 7:12 AM
by
Derik Whittaker