NUnit vs. MSTest Behavior
Posted by Marcus Wyatt on 29 May 2006
I’ve found the following odd behavioural difference in Assert.AreEqual between NUnit and Microsoft.VisualStudio.TestTools.UnitTesting.
In NUnit you can specify the following test that will pass:
public void IntegerLongComparison()
But when you try to do the same with Microsoft’s Unit testing framework it fails.
So this got me thinking. When comparing value types, do you fail the assertion when the types differ?
One part of me says, No! When you think about it, an integer value of 3 is the same as a double value of 3.
3 are 3, isn’t it…?
Well, yes and no. I’m kind of torn between the two arguments. Not sure which way to go on this problem…
What do you feel is the right behavior?
Currently listening to: ersion) – Winamp *** 1. 2 Brothers on the 4th Floor – Heaven is Here (Radio Version)