ExcludeFromCodeCoverage
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Interface)]
public class ExcludeFromCodeCoverageAttribute : Attribute
{
public ExcludeFromCodeCoverageAttribute(string reason = null)
{
Reason = Reason;
}
public string Reason { get; set; }
}
.runsettings .
...
<Configuration>
<CodeCoverage>
.
.
.
<Attributes>
<Exclude>
<Attribute>^YourCompany\.YourNameSpace\.sExcludeFromCodeCoverageAttribute$</Attribute>
</Exclude>
</Attributes>
.
.
.
</Configuration>
...
.