MSTEST0029: Public method should be test method
Property | Value |
---|---|
Rule ID | MSTEST0029 |
Title | Public method should be test method |
Category | Design |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default | No |
Default severity | Info |
Introduced in version | 3.5.0 |
There is a code fix | Yes |
Cause
A public
method should be a test method.
Rule description
A public
method of a class marked with [TestClass]
should be a test method (marked with [TestMethod]
). The rule ignores methods that are marked with [TestInitialize]
, or [TestCleanup]
attributes.
How to fix violations
Ensure that the public method is a test method (marked with [TestMethod]
).
When to suppress warnings
Do not suppress a warning from this rule. If you ignore this rule, the public method won't be considered as a test method.
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.