Hi,
I love the support for the ExcludeFromCodeCoverage attribute. Is there a way to indicate other attributes that should exclude class and methods from the coverage report?
The main use I would have for it would be to exclude compiler generate code, such as this:
Code:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BP.FofToLimUploader.Gui.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
Unfortunately this class isn't partial, so I can't manually add the ExcludeFromCoverage attribute, and so it always shows in the NCrunch metrics unless manually excluded in the GUI.
DotCover allows you to add any attribute in the list of attributes that should exclude coverage, which solved this issue quite nicely.
Is there a way to do something similar in NCrunch?
Thanks,
Nico