[TestMethod]
public void TestMethod1()
{
decimal d1 = 20;
decimal d2 = 20;
Assert.IsTrue(compare (d1, d2));
}
private bool compare (object o1, object o2)
{
return o1 == o2;
}
The test above will fail, should use this instead:
private bool compare (object o1, object o2)
{
return o1.Equals(o2);
}
No comments:
Post a Comment