Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,953 | Comments: 44,409

filter by tags archive

Comments

josh

well that's helpful

Oran

Yep, ran into that one a while ago...

http://code.google.com/p/mb-unit/issues/detail?id=114

Andrey Shchekin

It's funny that I have stumbled in the exactly same bug today.

Well, seems almost no one is actually using AreNotEqual if this lived to the 2.4.

Andy Stopford

Thanks Oren, I'll need to investigate this more but I think in the absence of an assert for Guid that MbUnit is casting to object and then equating as a null. The AreNotEqual has this gem.

if (expected == null ^ actual == null)

return;

As both become null in the cast it passes. Thats a complete guess at the moment until I can investigate more. Always fun.

Andy

James Curran

Maybe it been updated since the version I'm running (1.0.2700) but the real problem I see is that AreEqual(object, object) uses the object's Equals() methods (via ObjectsEqual) which is customized to the class, while AreNotEqual just uses !(obj==obj) which ultimately just Object.ReferenceEquals.

Stefan Wenig

That's because GUIDs are so unique that even two identical GUIDs are not quite equal. Duh.

arielr

That's nothing compared to my bug of the day:

try running this piece of code in the immediate window and then in the body of a funcion.

bool a = object.ReferenceEquals("A","A")

AndyKernahan

That's nothing compared to my bug of the day:

try running this piece of code in the immediate window and then in the body of a funcion.

bool a = object.ReferenceEquals("A","A")

a would be true as the compiler would have inturned the string "A"

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
  2. Special Offer (2):
    27 May 2015 - 29% discount for all our products
  3. RavenDB Sharding (3):
    22 May 2015 - Adding a new shard to an existing cluster, splitting the shard
  4. Challenge (45):
    28 Apr 2015 - What is the meaning of this change?
  5. Interview question (2):
    30 Mar 2015 - fix the index
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats