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
But this test fails with error message:
Expected: Foo
But was: Foo
It would work, if Foo would implement public override bool Equals(object objectToCompare) instead. But this change is not possible for legacy code reason.
It would probably better, if the Analyzer would check, if the called Equals method is an override from object or just an isolated implementation and ignore it in such case.
The text was updated successfully, but these errors were encountered:
I added a PR to exclude Equals implementation if the class doesn't implement the corresponding IEquality interface.
However, I'm not sure if this actually should be fixed in NUnit itself instead.
If a class A implements bool Equals(B) then Assert.That(B, Is.EqualTo(A)) should pass.
If there is a class Foo, implementing Equals in this way:
and Assert like:
NUnit2010 fix changes it to
But this test fails with error message:
Expected: Foo
But was: Foo
It would work, if Foo would implement public override bool Equals(object objectToCompare) instead. But this change is not possible for legacy code reason.
It would probably better, if the Analyzer would check, if the called Equals method is an override from object or just an isolated implementation and ignore it in such case.
The text was updated successfully, but these errors were encountered: