MSTEST0041: Use 'ConditionBaseAttribute' on test classes
Property | Value |
---|---|
Rule ID | MSTEST0041 |
Title | Use 'ConditionBaseAttribute' on test classes |
Category | Usage |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default | Yes |
Default severity | Warning |
Introduced in version | 3.8.0 |
Is there a code fix | No |
Cause
The use of an attribute that inherits from ConditionBaseAttribute on a class that is not marked with TestClassAttribute.
Rule description
An attribute that derives from ConditionBaseAttribute only has an effect when applied to a class that's marked with TestClassAttribute.
How to fix violations
Depending on the intent, either add the missing TestClassAttribute or remove the attribute that derives from ConditionBaseAttribute.
When to suppress warnings
Do not suppress a warning from this rule.
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.