示例#1
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());
        }
示例#2
0
        public void testToString_WithPrefix()
        {
            global::GitSharp.Core.Ref a = newRef("refs/heads/A", ID_ONE);
            global::GitSharp.Core.Ref b = newRef("refs/heads/foo/B", ID_TWO);
            global::GitSharp.Core.Ref c = newRef("refs/heads/foo/C", ID_TWO);
            global::GitSharp.Core.Ref g = newRef("refs/heads/g", ID_ONE);

            packed = toList(a, b, c, g);

            StringBuilder exp = new StringBuilder();
            exp.Append("[");
            exp.Append(b.ToString());
            exp.Append(", ");
            exp.Append(c.ToString());
            exp.Append("]");

            RefMap map = new RefMap("refs/heads/foo/", packed, loose, resolved);
            Assert.AreEqual(exp.ToString(), map.ToString());
        }
示例#3
0
文件: RefMapTest.cs 项目: shoff/ngit
		public virtual void TestToString_WithPrefix()
		{
			Ref a = NewRef("refs/heads/A", ID_ONE);
			Ref b = NewRef("refs/heads/foo/B", ID_TWO);
			Ref c = NewRef("refs/heads/foo/C", ID_TWO);
			Ref g = NewRef("refs/heads/g", ID_ONE);
			packed = ToList(a, b, c, g);
			StringBuilder exp = new StringBuilder();
			exp.Append("[");
			exp.Append(b.ToString());
			exp.Append(", ");
			exp.Append(c.ToString());
			exp.Append("]");
			RefMap map = new RefMap("refs/heads/foo/", packed, loose, resolved);
			NUnit.Framework.Assert.AreEqual(exp.ToString(), map.ToString());
		}
示例#4
0
文件: RefMapTest.cs 项目: shoff/ngit
		public virtual void TestToString_NoPrefix()
		{
			Ref a = NewRef("refs/heads/A", ID_ONE);
			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(string.Empty, packed, loose, resolved);
			NUnit.Framework.Assert.AreEqual(exp.ToString(), map.ToString());
		}