32 lines
511 B
Plaintext
32 lines
511 B
Plaintext
![]() |
:framework: MSTest
|
||
|
:classAnnotation: TestClass
|
||
|
|
||
|
== How to fix it in MSTest
|
||
|
|
||
|
include::how.adoc[]
|
||
|
|
||
|
* `TestMethod`
|
||
|
* `DataTestMethod`
|
||
|
|
||
|
=== Code examples
|
||
|
|
||
|
==== Noncompliant code example
|
||
|
|
||
|
[source,csharp,diff-id=1,diff-type=noncompliant]
|
||
|
----
|
||
|
[TestClass]
|
||
|
public class SomeOtherClassTest { } // Noncompliant: no test
|
||
|
----
|
||
|
|
||
|
==== Compliant solution
|
||
|
|
||
|
[source,csharp,diff-id=1,diff-type=compliant]
|
||
|
----
|
||
|
[TestClass]
|
||
|
public class SomeOtherClassTest
|
||
|
{
|
||
|
[TestMethod]
|
||
|
public void SomeMethodShouldReturnTrue() { }
|
||
|
}
|
||
|
----
|