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.
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.