Beispiel #1
0
        public virtual void TestAbbreviatePackedBlob()
        {
            RevBlob id = test.Blob("test");

            test.Branch("master").Commit().Add("test", id).Child();
            test.PackAndPrune();
            NUnit.Framework.Assert.IsTrue(reader.Has(id));
            NUnit.Framework.Assert.AreEqual(id.Abbreviate(7), reader.Abbreviate(id, 7));
            NUnit.Framework.Assert.AreEqual(id.Abbreviate(8), reader.Abbreviate(id, 8));
            NUnit.Framework.Assert.AreEqual(id.Abbreviate(10), reader.Abbreviate(id, 10));
            NUnit.Framework.Assert.AreEqual(id.Abbreviate(16), reader.Abbreviate(id, 16));
            ICollection <ObjectId> matches = reader.Resolve(reader.Abbreviate(id, 8));

            NUnit.Framework.Assert.IsNotNull(matches);
            NUnit.Framework.Assert.AreEqual(1, matches.Count);
            NUnit.Framework.Assert.AreEqual(id, matches.Iterator().Next());
            NUnit.Framework.Assert.AreEqual(id, db.Resolve(reader.Abbreviate(id, 8).Name));
        }