ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: NUnit. Incorrect range bounds. 'to' must be greater than or equal to 'from'

Last modified: 21 July 2022

The NUnit's Range Attribute allows specifying decreasing ranges of values, that is when from is greater that to.

However, to use a decreasing range of values, you must explicitly specify a negative step in the third argument. Another way to fix the problem is to swap the first and the second arguments so that the range becomes increasing.