Ejemplo n.º 1
0
        public void testEntryType()
        {
            global::GitSharp.Core.Ref a = newRef("refs/heads/A", ID_ONE);
            global::GitSharp.Core.Ref b = newRef("refs/heads/B", ID_TWO);

            packed = toList(a, b);

            RefMap map = new RefMap("refs/heads/", packed, loose, resolved);
            IteratorBase <RefMap.Ent> itr = map.entrySet().iterator();

            RefMap.Ent ent_a = itr.next();
            RefMap.Ent ent_b = itr.next();

            Assert.AreEqual(ent_a.GetHashCode(), "A".GetHashCode());
            Assert.IsTrue(ent_a.Equals(ent_a));
            Assert.IsFalse(ent_a.Equals(ent_b));

            Assert.AreEqual(a.ToString(), ent_a.ToString());
        }
Ejemplo n.º 2
0
        public void testToString_NoPrefix()
        {
            global::GitSharp.Core.Ref a = newRef("refs/heads/A", ID_ONE);
            global::GitSharp.Core.Ref b = newRef("refs/heads/B", ID_TWO);

            packed = toList(a, b);

            StringBuilder exp = new StringBuilder();

            exp.Append("[");
            exp.Append(a.ToString());
            exp.Append(", ");
            exp.Append(b.ToString());
            exp.Append("]");

            RefMap map = new RefMap("", packed, loose, resolved);

            Assert.AreEqual(exp.ToString(), map.ToString());
        }