File tree Expand file tree Collapse file tree 4 files changed +208
-4
lines changed
core/testing/mstest-analyzers Expand file tree Collapse file tree 4 files changed +208
-4
lines changed Original file line number Diff line number Diff line change @@ -32,20 +32,19 @@ A method marked with `[AssemblyInitialize]` should have valid layout.
3232
3333Methods 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
4444The 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
Original file line number Diff line number Diff line change @@ -32,20 +32,19 @@ A method marked with `[AssemblyCleanup]` should have valid layout.
3232
3333Methods 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
4444The 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
You can’t perform that action at this time.
0 commit comments