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/articles/nunit/writing-tests/attributes/testcase.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,43 @@ TestCaseAttribute supports a number of additional named parameters:
42
42
but may serve a purpose for the test author)
43
43
***TypeArgs** specifies the `Type`s to be used when targeting a generic test method. (_NUnit 4.1+_)
44
44
45
+
## Be aware of mixing the syntax for named parameters and attributes with the same name
46
+
47
+
### Correct `Ignore` Attribute Usage, by Example
48
+
49
+
> [!WARNING]
50
+
> When using the `Ignore` parameter (and others, see below), note that this has to be a named parameter. It is easy to accidentally add another `Ignore` attribute after the `TestCase` attribute. That will be the same as adding it separately, and it will apply to the complete fixture. This may apply to other named parameters, with names equal to other attributes, like the `Explicit` and `Category` parameters.
Note that adding the `Reason` is optional, and Visual Studio TestExplorer will not even show it.
75
+
76
+
### Correct `Category` Attribute Usage, by Example
77
+
78
+
Categories can be applied to a single `TestCase` the same way, as a named parameter. Otherwise, it will apply to the whole fixture. Be sure what you're asking for!
0 commit comments