MSTEST0016: Test class should have test method
Property | Value |
---|---|
Rule ID | MSTEST0016 |
Title | Test class should have test method |
Category | Design |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default | Yes |
Default severity | Info |
Introduced in version | 3.3.0 |
Cause
A test class should have a test method.
Rule description
A test class should have at least one test method or be static
and have methods that are attributed with [AssemblyInitialization]
or [AssemblyCleanup]
.
How to fix violations
Ensure that the test class has a test method or is static
and has methods attributed with [AssemblyInitialization]
or [AssemblyCleanup]
.
When to suppress warnings
Do not suppress a warning from this rule. If you ignore this rule, test class will be ignored.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for