CompareTo() public method

Compares capabilities based on name, then version
public CompareTo ( object other ) : int
other object
return 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));
        }