Skip to content

Commit 1337c3d

Browse files
committed
Some changes
1 parent 615579c commit 1337c3d

File tree

1 file changed

+13
-13
lines changed
  • docs/articles/nunit/writing-tests/attributes

1 file changed

+13
-13
lines changed

docs/articles/nunit/writing-tests/attributes/testcase.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,37 @@ TestCaseAttribute supports a number of additional named parameters:
4444

4545
## Be aware of mixing the syntax for named parameters and attributes with the same name
4646

47-
### Ignore done right and wrong
47+
### Correct `Ignore` Attribute Usage, by Example
4848

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 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. Note, that this might apply to more of these named parameters, with names equal to other attributes, like the Explicit and Category parameters.
51-
52-
[!TIP]
53-
Doing it right!
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.
5451
52+
Correct example usage
5553
[!code-csharp[TestCaseWithIgnore](~/snippets/Snippets.NUnit/Attributes/TestCaseAttributeExamples.cs#TestCaseWithIgnore)]
5654

5755
![TestCaseIgnoreDoneCorrect](../../../../images/TestCaseIgnoreDoneCorrect.png)
5856

59-
[!WARNING]
60-
Wrong way! (1) Adding it on the same line is the same as adding it on a separate line (3), both results in the fixture being ignored (2).
57+
> [!WARNING]
58+
> **Wrong way!** Below, we demonstrate an incorrect approach.
59+
>
60+
> (1) Adding it on the same line is the same as adding it on a separate line (3), both results in the fixture being ignored (2).
6161
6262
![TestCaseIgnoreGoneWrong](../../../../images/TestCaseIgnoreGoneWrong.png)
6363

6464
<!-- cspell:disable-next-line -->
6565
_Thanks to [Geir Marius Gjul](https://github.com/GeirMG) for raising this question again._
6666

67-
### Explicit done correct
67+
### Correct `Explicit` Attribute Usage, by Example
6868

69-
Explicit is another one, and done correctly as:
69+
`Explicit`, used correctly, looks like the following:
7070

7171
[!code-csharp[TestCaseWithExplicit](~/snippets/Snippets.NUnit/Attributes/TestCaseAttributeExamples.cs#TestCaseWithExplicit)]
7272

73-
Note that adding the Reason is optional, and Visual Studio TestExplorer will not even show it.
73+
Note that adding the `Reason` is optional, and Visual Studio TestExplorer will not even show it.
7474

75-
### Category done correct
75+
### Correct `Category` Attribute Usage, by Example
7676

77-
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!
77+
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!
7878

7979
[!code-csharp[TestCaseWithCategory](~/snippets/Snippets.NUnit/Attributes/TestCaseAttributeExamples.cs#TestCaseWithCategory)]
8080

0 commit comments

Comments
 (0)