public virtual void TestConstructor_PeeledStatusNotKnown() { 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.Unpeeled(RefStorage.PACKED, name, ID_A); NUnit.Framework.Assert.AreEqual(RefStorage.PACKED, r.GetStorage()); r = new ObjectIdRef.Unpeeled(RefStorage.LOOSE_PACKED, name, ID_A); NUnit.Framework.Assert.AreEqual(RefStorage.LOOSE_PACKED, r.GetStorage()); r = new ObjectIdRef.Unpeeled(RefStorage.NEW, name, null); NUnit.Framework.Assert.AreEqual(RefStorage.NEW, r.GetStorage()); NUnit.Framework.Assert.AreSame(name, r.GetName()); NUnit.Framework.Assert.IsNull(r.GetObjectId(), "no id on new ref"); 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"); }
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()); }