ReSharper 2024.1 Help

Code Inspection: NUnit. Parameters without provided values in test method

Category

NUnit

ID

NUnit.MethodWithParametersAndTestAttribute

EditorConfig

resharper_n_unit_method_with_parameters_and_test_attribute_highlighting

Default severity

Warning

Language

C#

Requires SWA

No

If you write parameterized NUnit tests, you must provide data values for each test parameter. There are different ways in which you can specify data values, which are described in the Parameterized Tests section of the NUnit documentation.

[Test] // No values for parameter 'x' public void MyTest(int x) { // do something }
[Test] // Test will be executed with 'x = 10' public void MyTest([Values(10)] int x) { // do something }
Last modified: 15 April 2024