2023-06-06 16:24:33 +02:00
|
|
|
:framework: NUnit
|
|
|
|
:classAnnotation: TestFixture
|
|
|
|
|
|
|
|
== How to fix it in NUnit
|
|
|
|
|
|
|
|
include::how.adoc[]
|
|
|
|
|
|
|
|
* `Test`
|
|
|
|
* `TestCase`
|
|
|
|
* `TestCaseSource`
|
|
|
|
* `Theory`
|
|
|
|
|
|
|
|
=== Code examples
|
|
|
|
|
|
|
|
==== Noncompliant code example
|
|
|
|
|
2023-08-15 14:19:27 +02:00
|
|
|
[source,csharp,diff-id=11,diff-type=noncompliant]
|
2023-06-06 16:24:33 +02:00
|
|
|
----
|
|
|
|
[TestFixture]
|
|
|
|
public class SomeClassTest { } // Noncompliant: no test
|
|
|
|
----
|
|
|
|
|
|
|
|
==== Compliant solution
|
|
|
|
|
2023-08-15 14:19:27 +02:00
|
|
|
[source,csharp,diff-id=11,diff-type=compliant]
|
2023-06-06 16:24:33 +02:00
|
|
|
----
|
|
|
|
[TestFixture]
|
|
|
|
public class SomeClassTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void SomeMethodShouldReturnTrue() { }
|
|
|
|
}
|
|
|
|
----
|