ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: NUnit. No values provided in the attributes.

Last modified: 11 February 2024

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:

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.