CompareTo() 공개 메소드

Compares capabilities based on name, then version
public CompareTo ( object other ) : int
other object
리턴 int
예제 #1
0
        public void TestCompareTo_Version()
        {
            var a = new Capability("capA", new Version("1.0"));
            var b = new Capability("capA", new Version("1.1"));

            Assert.IsTrue(a.CompareTo(b) < 0);
            Assert.IsTrue(b.CompareTo(a) > 0);
        }
예제 #2
0
        public void TestCompareTo_Equal()
        {
            var a = new Capability("capA", new Version("1.0"));
            var b = new Capability("capA", new Version("1.0"));

            Assert.IsTrue(a.CompareTo(b) == 0);
            Assert.IsTrue(a.Equals(b));
        }