You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With new overloads to EqualTo in 4.3.0 we can no longer uniquely determine default.
But even in older cases, default would always mean default(object) which would be null.
This is likely not the intention of the caller when they use:
Assert.That(false, Is.EqualTo(default));`
As this compares a boolean with null which always fails:
Assert.That(true, Is.EqualTo(default))
Expected: null
But was: True
Assert.That(false, Is.EqualTo(default))
Expected: null
But was: False
Add a rule that warns about Is.EqualTo(default) and convert this to Is.Default for NUnit 4.
For NUnit 3 we could translate:
With new overloads to
EqualTo
in 4.3.0 we can no longer uniquely determinedefault
.But even in older cases,
default
would always meandefault(object)
which would benull
.This is likely not the intention of the caller when they use:
As this compares a boolean with
null
which always fails:Add a rule that warns about
Is.EqualTo(default)
and convert this toIs.Default
for NUnit 4.For NUnit 3 we could translate:
with:
The text was updated successfully, but these errors were encountered: