Beispiel #1
0
        public void TestCompareTo()
        {
            VisitableHashtable <string, string> h1 = GetTestHashtable();
            VisitableHashtable <string, string> h2 = GetTestHashtable();

            h2.Add("d", "dd");

            Assert.AreEqual(h1.CompareTo(h2), -1);
            Assert.AreEqual(h2.CompareTo(h1), 1);
            Assert.AreEqual(h1.CompareTo(h1), 0);

            object o = new object();

            Assert.AreEqual(h1.CompareTo(o), -1);
        }
Beispiel #2
0
        public void TestInvalidCompareTo()
        {
            VisitableHashtable <string, int> h = new VisitableHashtable <string, int>();

            h.CompareTo(null);
        }