You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/testing/mstest-analyzers/mstest0007.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,11 @@ A method that's not marked with <xref:Microsoft.VisualStudio.TestTools.UnitTesti
32
32
33
33
The following test attributes should only be applied on methods marked with the <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute> attribute:
|**Title**| Use 'ConditionBaseAttribute' on test classes |
20
+
|**Category**| Usage |
21
+
|**Fix is breaking or non-breaking**| Non-breaking |
22
+
|**Enabled by default**| Yes |
23
+
|**Default severity**| Warning |
24
+
|**Introduced in version**| 3.8.0 |
25
+
|**Is there a code fix**| No |
26
+
27
+
## Cause
28
+
29
+
The use of an attribute that inherits from <xref:Microsoft.VisualStudio.TestTools.UnitTesting.ConditionBaseAttribute> on a class that is not marked with <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute>.
30
+
31
+
## Rule description
32
+
33
+
An attribute that derives from <xref:Microsoft.VisualStudio.TestTools.UnitTesting.ConditionBaseAttribute> only has an effect when applied to a class that's marked with <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute>.
34
+
35
+
## How to fix violations
36
+
37
+
Depending on the intent, either add the missing <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute> or remove the attribute that derives from <xref:Microsoft.VisualStudio.TestTools.UnitTesting.ConditionBaseAttribute>.
0 commit comments