If you try this (in VB, but I can translate if you cannot read
it :) ):

dim expected as object = ctype("150000",Decimal)
dim actual as object = ctype("150000.00",Decimal)
mbunit.Framework.Assert.AreEqual(expected,actual);

You will get a failure. If you read the bits, you will see that
internal representations are different:
?decimal.GetBits(ctype("150000.00",Decimal))
{Length=4}
   (0): 15000000
   (1): 0
   (2): 0
   (3): 131072

?decimal.GetBits(ctype("150000",Decimal))
{Length=4}
   (0): 150000
   (1): 0
   (2): 0
   (3): 0

I was looking at what ObjectEquals does, and it converts both objects
to strings before comparing them. I guess this is why
Assert.AreEqual() fails. However, the CompareTo of the IComparable
interface works well, so why don't you use it?

I am now using version 2.4.190.

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to