From version 4.3.0 the numeric equality is type aware, where the type passed to Within must be the same as the type passed to EqualTo:
e.g.: Is.EqualTo(0L).Within(0.1)); result in an error as it isn't clear if the user wanted integral comparison (EqualTo(0L)) or floating point Within(0.1)
We can follow two paths:
- Ignore the
0L and assume all comparison with a Within are double. This would need changing in NUnit.
- Warn in the analyzer about the different types and allow a code fix to change
0L into 0.0. Or in case of a non-constant to add a cast.