コード例 #1
0
        public void testPrefixCompare_Full()
        {
            const string        s1 = "7b6e8067ec96acef9a4184b43210d583b6d2f99a";
            AbbreviatedObjectId a  = AbbreviatedObjectId.FromString(s1);
            ObjectId            i1 = ObjectId.FromString(s1);

            Assert.AreEqual(0, a.prefixCompare(i1));
            Assert.IsTrue(i1.startsWith(a));

            const string s2 = "7b6e8067ec96acef9a4184b43210d583b6d2f99b";
            ObjectId     i2 = ObjectId.FromString(s2);

            Assert.IsTrue(a.prefixCompare(i2) < 0);
            Assert.IsFalse(i2.startsWith(a));

            const string s3 = "7b6e8067ec96acef9a4184b43210d583b6d2f999";
            ObjectId     i3 = ObjectId.FromString(s3);

            Assert.IsTrue(a.prefixCompare(i3) > 0);
            Assert.IsFalse(i3.startsWith(a));
        }