Beispiel #1
0
        public void CompareTo_Guid()
        {
            var id1 = new ObjectID(typeof(Order), new Guid("{5682F032-2F0B-494b-A31C-C97F02B89C36}"));
            var id2 = new ObjectID(typeof(Order), new Guid("{5682F032-2F0B-494b-A31C-C97F02B89C37}"));
            var id3 = new ObjectID(typeof(Order), new Guid("{5682F032-2F0B-494b-A31C-C97F02B89C36}"));

            Assert.That(id1.CompareTo(id2), Is.EqualTo(-1));
            Assert.That(id2.CompareTo(id1), Is.EqualTo(1));
            Assert.That(id1.CompareTo(id3), Is.EqualTo(0));
        }
Beispiel #2
0
        public void CompareTo_String()
        {
            var id1 = new ObjectID("Official", "aaa");
            var id2 = new ObjectID("Official", "bbb");
            var id3 = new ObjectID("Official", "aaa");

            Assert.That(id1.CompareTo(id2), Is.EqualTo(-1));
            Assert.That(id2.CompareTo(id1), Is.EqualTo(1));
            Assert.That(id1.CompareTo(id3), Is.EqualTo(0));
        }
Beispiel #3
0
        public void CompareTo_DifferentValueTypes()
        {
            var id1 = new ObjectID(typeof(Order), new Guid("{5682F032-2F0B-494b-A31C-C97F02B89C36}"));
            var id2 = new ObjectID("Official", "test");

            Assert.That(id1.CompareTo(id2), Is.EqualTo(1));
            Assert.That(id2.CompareTo(id1), Is.EqualTo(-1));
        }
Beispiel #4
0
        public void CompareTo_InvalidArgument()
        {
            var id = new ObjectID("Official", "aaa");

            id.CompareTo("test");
        }