Exemple #1
0
        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");
        }
Exemple #2
0
        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");
        }
Exemple #3
0
        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");
        }