Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update description for (init/cleanup) analyzers #3391

Merged
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 66 additions & 48 deletions src/Analyzers/MSTest.Analyzers/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 92 additions & 48 deletions src/Analyzers/MSTest.Analyzers/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,21 @@
</resheader>
<data name="AssemblyCleanupShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [AssemblyCleanup] should follow the following layout to be valid:
- be 'public'
- be 'static'
- not be generic nor defined on a generic class
- not take any parameter
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...).</value>
-it can't be declared on a generic class
-it should be public
-it should be static
-it should not be async void
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should not take any parameter
-return type should be void, Task or ValueTask

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-The class should be marked with [TestClass] (or a derived attribute)
-the class should not be generic.</value>
</data>
<data name="AssemblyCleanupShouldBeValidMessageFormat" xml:space="preserve">
<value>AssemblyCleanup method '{0}' signature is invalid</value>
Expand All @@ -135,13 +143,21 @@
</data>
<data name="AssemblyInitializeShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [AssemblyInitialize] should follow the following layout to be valid:
- be 'public'
- be 'static'
- not be generic nor be defined on a generic class
- take a single parameter of type 'TestContext'
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...).</value>
-it can't be declared on a generic class
-it should be public
-it should be static
-it should not be async void
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should take one parameter of type TestContext
-return type should be void, Task or ValueTask

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-The class should be marked with [TestClass] (or a derived attribute)
-the class should not be generic.</value>
</data>
<data name="AssemblyInitializeShouldBeValidMessageFormat" xml:space="preserve">
<value>AssemblyInitialize method '{0}' signature is invalid</value>
Expand Down Expand Up @@ -175,15 +191,23 @@
</data>
<data name="ClassCleanupShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [ClassCleanup] should follow the following layout to be valid:
- be 'public'
- not be 'static'
- not be generic nor defined on a generic class
- not take any parameter
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...)
-'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
-'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'.</value>
-it can't be declared on a generic class without the InheritanceBehavior mode is set
-it should be public
-it should be static
-it should not be async void
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should not take any parameter
-return type should be void, Task or ValueTask
-InheritanceBehavior.BeforeEachDerivedClass attribute parameter should be specified if the class is abstract.
-InheritanceBehavior.BeforeEachDerivedClass attribute parameter should not be specified if the class is `sealed`.

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-If the class is sealed, it should be marked with [TestClass] (or a derived attribute)
-the class should not be generic.</value>
</data>
<data name="ClassCleanupShouldBeValidMessageFormat" xml:space="preserve">
<value>ClassCleanup method '{0}' signature is invalid</value>
Expand All @@ -193,15 +217,23 @@
</data>
<data name="ClassInitializeShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [ClassInitialize] should follow the following layout to be valid:
- be 'public'
- be 'static'
- not be generic nor be defined on a generic class
- take a single parameter of type 'TestContext'
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...)
-'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
-'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'.</value>
-it can't be declared on a generic class without the InheritanceBehavior mode is set
-it should be public
-it should be static
-it should not be async void
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should take one parameter of type TestContext
-return type should be void, Task or ValueTask
-InheritanceBehavior.BeforeEachDerivedClass attribute parameter should be specified if the class is abstract.
-InheritanceBehavior.BeforeEachDerivedClass attribute parameter should not be specified if the class is `sealed`.

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-If the class is sealed, it should be marked with [TestClass] (or a derived attribute)
-the class should not be generic.</value>
</data>
<data name="ClassInitializeShouldBeValidMessageFormat" xml:space="preserve">
<value>ClassInitialize method '{0}' signature is invalid</value>
Expand Down Expand Up @@ -316,14 +348,20 @@
</data>
<data name="TestCleanupShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [TestCleanup] should follow the following layout to be valid:
- be 'public'
- not be 'static'
- not be generic or be defined on a generic class
- not be 'abstract'
- not take any parameter
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...).</value>
-it should be public
-it should not be abstract
-it should not be async void
-it should not be static
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should not take any parameter
-return type should be void, Task or ValueTask

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-If the class is sealed, it should be marked with [TestClass] (or a derived attribute).</value>
</data>
<data name="TestCleanupShouldBeValidMessageFormat" xml:space="preserve">
<value>TestCleanup method '{0}' signature is invalid</value>
Expand Down Expand Up @@ -358,14 +396,20 @@
</data>
<data name="TestInitializeShouldBeValidDescription" xml:space="preserve">
<value>Methods marked with [TestInitialize] should follow the following layout to be valid:
- be 'public'
- not be 'static'
- not be generic nor defined on a generic class
- not be 'abstract'
- not take any parameter
- return type should be 'void', 'Task' or 'ValueTask'
- not be 'async void'
- not be a special method (finalizer, operator...).</value>
-it should be public
-it should not be abstract
-it should not be async void
-it should not be static
-it should not be a special method (finalizer, operator...).
-it should not be generic
-it should not take any parameter
-return type should be void, Task or ValueTask

The type declaring these methods should also respect the following rules:
-The type should be a class.
-The class should be public or internal (if the test project is using the [DiscoverInternals] attribute).
-The class shouldn't be static.
-If the class is sealed, it should be marked with [TestClass] (or a derived attribute).</value>
</data>
<data name="TestInitializeShouldBeValidMessageFormat" xml:space="preserve">
<value>TestInitialize method '{0}' signature is invalid</value>
Expand Down
Loading