Code Inspection: NUnit. Redundant argument instead of ExpectedResult
Last modified: 21 July 2022tip
The arguments of NUnit's TestCase attribute can be used for providing both values for test parameters and the expected result of the test. The expected result must be always specified by using the named parameter ExpectedResult
.
If the test method returns a value and ReSharper finds an argument with a data value instead of ExpectedResult
, it issues a warning and provides a quick-fix that converts the value to the expected result.