Ejemplo n.º 1
0
        public void testEmpty_NoPrefix1()
        {
            RefMap map = new RefMap("", packed, loose, resolved);
            Assert.IsTrue(map.isEmpty()); // before size was computed
            Assert.AreEqual(0, map.size());
            Assert.IsTrue(map.isEmpty()); // after size was computed

            Assert.IsFalse(map.entrySet().iterator().hasNext());
            Assert.IsFalse(map.keySet().iterator().hasNext());
            Assert.IsFalse(map.containsKey("a"));
            Assert.IsNull(map.get("a"));
        }
Ejemplo n.º 2
0
        public void testEmpty_NoPrefix2()
        {
            RefMap map = new RefMap();

            Assert.IsTrue(map.isEmpty()); // before size was computed
            Assert.AreEqual(0, map.size());
            Assert.IsTrue(map.isEmpty()); // after size was computed

            Assert.IsFalse(map.entrySet().iterator().hasNext());
            Assert.IsFalse(map.keySet().iterator().hasNext());
            Assert.IsFalse(map.containsKey("a"));
            Assert.IsNull(map.get("a"));
        }
Ejemplo n.º 3
0
        public void testEmpty_WithPrefix()
        {
            global::GitSharp.Core.Ref master = newRef("refs/heads/master", ID_ONE);
            packed = toList(master);

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

            Assert.IsTrue(map.isEmpty()); // before size was computed
            Assert.AreEqual(0, map.size());
            Assert.IsTrue(map.isEmpty()); // after size was computed

            Assert.IsFalse(map.entrySet().iterator().hasNext());
            Assert.IsFalse(map.keySet().iterator().hasNext());
        }
Ejemplo n.º 4
0
        public void testEmpty_WithPrefix()
        {
            global::GitSharp.Core.Ref master = newRef("refs/heads/master", ID_ONE);
            packed = toList(master);

            RefMap map = new RefMap("refs/tags/", packed, loose, resolved);
            Assert.IsTrue(map.isEmpty()); // before size was computed
            Assert.AreEqual(0, map.size());
            Assert.IsTrue(map.isEmpty()); // after size was computed

            Assert.IsFalse(map.entrySet().iterator().hasNext());
            Assert.IsFalse(map.keySet().iterator().hasNext());
        }