예제 #1
0
        public void TestCompareTo()
        {
            PascalSet s1 = new PascalSet(0, 50, new int[] { 20, 30, 40 });
            PascalSet s2 = new PascalSet(0, 50, new int[] { 20, 25, 30, 40 });

            Assert.AreEqual(s1.CompareTo(s2), -1);
            Assert.AreEqual(s2.CompareTo(s1), 1);
            Assert.AreEqual(s1.CompareTo(s1), 0);

            object obj = new object();

            Assert.AreEqual(s1.CompareTo(obj), -1);
        }
예제 #2
0
        public void TestInvalidCompareTo()
        {
            PascalSet p = new PascalSet(0, 50);

            p.CompareTo(null);
        }