コード例 #1
0
        public virtual void TestCompareTo()
        {
            FacetLabel p      = new FacetLabel("a", "b", "c", "d");
            FacetLabel pother = new FacetLabel("a", "b", "c", "d");

            Assert.AreEqual(0, pother.CompareTo(p));
            Assert.AreEqual(0, p.CompareTo(pother));
            pother = new FacetLabel();
            Assert.True(pother.CompareTo(p) < 0);
            Assert.True(p.CompareTo(pother) > 0);
            pother = new FacetLabel("a", "b_", "c", "d");
            Assert.True(pother.CompareTo(p) > 0);
            Assert.True(p.CompareTo(pother) < 0);
            pother = new FacetLabel("a", "b", "c");
            Assert.True(pother.CompareTo(p) < 0);
            Assert.True(p.CompareTo(pother) > 0);
            pother = new FacetLabel("a", "b", "c", "e");
            Assert.True(pother.CompareTo(p) > 0);
            Assert.True(p.CompareTo(pother) < 0);
        }