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. Test case Result property duplicates ExpectedResult.

Last modified: 11 February 2024

Starting from NUnit 2.6.2, the named parameter Result of the TestCase Attribute, which you can use to specify the expected result to be returned from the test method, becomes deprecated in favor of the ExpectedResult parameter, which serves the same purpose.

Starting from NUnit 3.0, Result is not supported anymore and any tests that use this parameter will not compile with NUnit 3.0.

If both Result and ExpectedResult are accidentally used in the attributes of TestCase, the Result is redundant and should be removed.