public void CompareToTest1() { var a = new FaceVal(20); var result1 = a.CompareTo(10); var result2 = a.CompareTo(20); var result3 = a.CompareTo(30); Assert.IsTrue(result1 > 0, "CompareToTest FAIL"); Assert.IsTrue(result2 == 0, "CompareToTest FAIL"); Assert.IsTrue(result3 < 0, "CompareToTest FAIL"); }
public void CompareToTest3() { var a = new FaceVal('B'); var result = a.CompareTo('B') == 0; Assert.IsTrue(result, "CompareToTest3 FAIL"); result = a.CompareTo('A') > 0; Assert.IsTrue(result, "CompareToTest3 FAIL"); result = a.CompareTo('C') < 0; Assert.IsTrue(result, "CompareToTest3 FAIL"); }
public void CompareToTest2() { var a = new FaceVal('A'); var b = new FaceVal('B'); var c = new FaceVal('C'); var result = b.CompareTo(a) > 0; Assert.IsTrue(result, "EqualsTest4 FAIL"); result = b.CompareTo(b) == 0; Assert.IsTrue(result, "EqualsTest4 FAIL"); result = b.CompareTo(c) < 0; Assert.IsTrue(result, "EqualsTest4 FAIL"); }