JetBrains Rider 2020.2 Help

Maintain Code Quality of Unit Tests

One of the most powerful JetBrains Rider features, code inspection, comes in handy when you write unit tests. In addition to hundreds of general-purpose inspections, there is also a number of dedicated inspections that target problems specific to unit tests:

NUnit (27 inspections)

These inspections detect code issues related to NUnit tests.
Inspection Default severity
NUnit. Async test method must return Task or Task<T>Warning
NUnit. Cannot resolve symbol in TestCaseSource or ValueSource attributeWarning
NUnit. Duplicate valuesWarning
NUnit. Ignored parameter attributeWarning
NUnit. Implicitly unspecified null valuesWarning
NUnit. Incompatible argument type or incorrect argument valueWarning
NUnit. Incompatible expected result type or incorrect valueWarning
NUnit. Incorrect range bounds. 'to' must be greater than or equal to 'from'Warning
NUnit. Mismatch of the range step signWarning
NUnit. Missing arguments in TestCase attributeWarning
NUnit. Missing expected result for non-void test methodWarning
NUnit. No values provided in the attributesWarning
NUnit. Non-public test methodWarning
NUnit. Range 'step' parameter value must be non-zeroWarning
NUnit. Redundant argument in TestCase attributeWarning
NUnit. Redundant argument instead of ExpectedResultWarning
NUnit. Redundant expected result for void test methodWarning
NUnit. Specified attribute values produce too many testsDisabled
NUnit. Specified values are not compatible with the test parameter typeWarning
NUnit. Test case Result property duplicates ExpectedResultWarning
NUnit. Test case Result property is obsoleteWarning
NUnit. Test case source must be field, property, or methodWarning
NUnit. Test case source must be non-abstract and implement IEnumerableWarning
NUnit. Test case source must be staticWarning
NUnit. The maximum range value is not reachable with the step valueWarning
NUnit. Values for test method parameters are not providedWarning
NUnit. Values in range do not fit the type of the test parameterWarning

Xunit (1 inspection)

These inspections detect code issues related to xUnit.Net tests.
Last modified: 08 May 2020