-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
Description
Description
NumericAssertions uses CompareTo to decide if a subject is e.g. smaller than the expected.
That is technically mixing different concepts, as CompareTo only decides the relative ordering between two items, i.e. how they should be sorted.
What NumericAssertions should be doing when "comparing" is arithmetic comparisons that corresponds to using operators like <, == and so on.
Complete minimal example reproducing the issue
double.NaN.Should().BeLessThan(0);Expected behavior:
Should fail, as comparing NaN to anything using <, <=, ==, >= or > returns false.
Actual behavior:
The test passes.
Versions
- Which version of Fluent Assertions are you using?
- 6.1.0 (master)