Skip to content

Commit 8307e0b

Browse files
authored
Fix MSTEST0012/MSTEST0013 documentation about test class being static (#44431)
1 parent f2884b4 commit 8307e0b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/core/testing/mstest-analyzers/mstest0012.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,19 @@ A method marked with `[AssemblyInitialize]` should have valid layout.
3232

3333
Methods marked with `[AssemblyInitialize]` should follow the following layout to be valid:
3434

35-
- it can't be declared on a generic class
3635
- it should be `public`
3736
- it should be `static`
3837
- it should not be `async void`
3938
- it should not be a special method (finalizer, operator...).
4039
- it should not be generic
40+
- it should not be abstract
4141
- it should take one parameter of type `TestContext`
4242
- return type should be `void`, `Task` or `ValueTask`
4343

4444
The type declaring these methods should also respect the following rules:
4545

4646
- The type should be a class.
4747
- The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
48-
- The class shouldn't be static.
4948
- The class should be marked with [TestClass] (or a derived attribute)
5049
- the class should not be generic
5150

docs/core/testing/mstest-analyzers/mstest0013.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,19 @@ A method marked with `[AssemblyCleanup]` should have valid layout.
3232

3333
Methods marked with `[AssemblyCleanup]` should follow the following layout to be valid:
3434

35-
- it can't be declared on a generic class
3635
- it should be `public`
3736
- it should be `static`
3837
- it should not be `async void`
3938
- it should not be a special method (finalizer, operator...).
4039
- it should not be generic
40+
- it should not be abstract
4141
- it should not take any parameter, or starting with MSTest 3.8, it can have a single `TestContext` parameter
4242
- return type should be `void`, `Task` or `ValueTask`
4343

4444
The type declaring these methods should also respect the following rules:
4545

4646
- The type should be a class.
4747
- The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
48-
- The class shouldn't be static.
4948
- The class should be marked with [TestClass] (or a derived attribute)
5049
- the class should not be generic
5150

0 commit comments

Comments
 (0)