Code Inspection: NUnit. No values provided in the attributes
Starting from NUnit 3.0, you can use the Values Attribute without any arguments with parameters of the type enum
and bool
to use all possible values of the enumeration in the test. NUnit 3.11 extends this functionality to enum?
and bool?
.
If [Values]
without arguments is used for other parameter types, the test will do nothing:
[Test]
public void MyTest(
// No values provided in the attribute
[Values] int x)
{
// do something
}
This inspection will also issue a warning if you use [Values]
without arguments with an enum
or a bool
parameter and the current NUnit version is earlier that 3.0.
Similarly, it will warn you if you use [Values]
without arguments with an enum?
or a bool?
parameter, and NUnit earlier that 3.11.
Last modified: 21 July 2022