コード例 #1
0
        public virtual void TestConstructor_Peeled()
        {
            ObjectIdRef r;

            r = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, name, ID_A);
            NUnit.Framework.Assert.AreEqual(RefStorage.LOOSE, r.GetStorage());
            NUnit.Framework.Assert.AreSame(name, r.GetName());
            NUnit.Framework.Assert.AreSame(ID_A, r.GetObjectId());
            NUnit.Framework.Assert.IsFalse(r.IsPeeled(), "not peeled");
            NUnit.Framework.Assert.IsNull(r.GetPeeledObjectId(), "no peel id");
            NUnit.Framework.Assert.AreSame(r, r.GetLeaf(), "leaf is this");
            NUnit.Framework.Assert.AreSame(r, r.GetTarget(), "target is this");
            NUnit.Framework.Assert.IsFalse(r.IsSymbolic(), "not symbolic");
            r = new ObjectIdRef.PeeledNonTag(RefStorage.LOOSE, name, ID_A);
            NUnit.Framework.Assert.IsTrue(r.IsPeeled(), "is peeled");
            NUnit.Framework.Assert.IsNull(r.GetPeeledObjectId(), "no peel id");
            r = new ObjectIdRef.PeeledTag(RefStorage.LOOSE, name, ID_A, ID_B);
            NUnit.Framework.Assert.IsTrue(r.IsPeeled(), "is peeled");
            NUnit.Framework.Assert.AreSame(ID_B, r.GetPeeledObjectId());
        }
コード例 #2
0
ファイル: ObjectIdRefTest.cs プロジェクト: LunarLanding/ngit
		public virtual void TestConstructor_Peeled()
		{
			ObjectIdRef r;
			r = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, name, ID_A);
			NUnit.Framework.Assert.AreEqual(RefStorage.LOOSE, r.GetStorage());
			NUnit.Framework.Assert.AreSame(name, r.GetName());
			NUnit.Framework.Assert.AreSame(ID_A, r.GetObjectId());
			NUnit.Framework.Assert.IsFalse(r.IsPeeled(), "not peeled");
			NUnit.Framework.Assert.IsNull(r.GetPeeledObjectId(), "no peel id");
			NUnit.Framework.Assert.AreSame(r, r.GetLeaf(), "leaf is this");
			NUnit.Framework.Assert.AreSame(r, r.GetTarget(), "target is this");
			NUnit.Framework.Assert.IsFalse(r.IsSymbolic(), "not symbolic");
			r = new ObjectIdRef.PeeledNonTag(RefStorage.LOOSE, name, ID_A);
			NUnit.Framework.Assert.IsTrue(r.IsPeeled(), "is peeled");
			NUnit.Framework.Assert.IsNull(r.GetPeeledObjectId(), "no peel id");
			r = new ObjectIdRef.PeeledTag(RefStorage.LOOSE, name, ID_A, ID_B);
			NUnit.Framework.Assert.IsTrue(r.IsPeeled(), "is peeled");
			NUnit.Framework.Assert.AreSame(ID_B, r.GetPeeledObjectId());
		}