Comment 2 for bug 1157828

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 1157828] Re: EqualityComparer does not respect value-equality for null

The NUnit equality model has handled null reference the same way for 13
years, so I hesitate to change it in any way that will break existing
applications.

I agree with Simone that IsNull should not pass with anything except the
null reference.

If there is a way we can make the two AreEqual tests pass without breaking
other tests, then I might consider that. However, I'm dubious of the value
of such an addition since use of AreEqual is not the way to test that the
NullObject in question works. The right way is to call the object's Equals
overload directly and find out what it returns.

Testing by using Assert.AreEqual verifies that the object's implementation
of equality matches NUnit's. I don't think that's what you want to test.

I'm inclined to reject this on the grounds of utility, but I'd like to hear
the other side first.

Charlie

On Thu, Mar 21, 2013 at 3:26 PM, Simone Busoli
<email address hidden>wrote:

> Looks like a valid scenario in my opinion. It's not straightforward to
> get right as we're doing all sorts of equality in NUnit but I put
> together a spike which passes all tests plus the ones Meg posted here
> except the Is.Null one. I think that one should not be supported as
> Is.Null should check for reference equality, which you cannot override.
>
> I would like to hear what Charlie thinks too.
>
> lp:~simone.busoli/nunitv2/null-equality
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https://bugs.launchpad.net/bugs/1157828
>
> Title:
> EqualityComparer does not respect value-equality for null
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunitv2/+bug/1157828/+subscriptions
>