Ejemplo n.º 1
0
        public void testConstructor_PeeledStatusNotKnown()
        {
            ObjectIdRef r;

            r = new Unpeeled(Storage.Loose, name, ID_A);
            Assert.AreSame(Storage.Loose, r.getStorage());
            Assert.AreSame(name, r.getName());
            Assert.AreSame(ID_A, r.getObjectId());
            Assert.IsFalse(r.isPeeled(), "not peeled");
            Assert.IsNull(r.getPeeledObjectId(), "no peel id");
            Assert.AreSame(r, r.getLeaf(), "leaf is this");
            Assert.AreSame(r, r.getTarget(), "target is this");
            Assert.IsFalse(r.isSymbolic(), "not symbolic");

            r = new Unpeeled(Storage.Packed, name, ID_A);
            Assert.AreSame(Storage.Packed, r.getStorage());

            r = new Unpeeled(Storage.LoosePacked, name, ID_A);
            Assert.AreSame(Storage.LoosePacked, r.getStorage());

            r = new Unpeeled(Storage.New, name, null);
            Assert.AreSame(Storage.New, r.getStorage());
            Assert.AreSame(name, r.getName());
            Assert.IsNull(r.getObjectId(), "no id on new ref");
            Assert.IsFalse(r.isPeeled(), "not peeled");
            Assert.IsNull(r.getPeeledObjectId(), "no peel id");
            Assert.AreSame(r, r.getLeaf(), "leaf is this");
            Assert.AreSame(r, r.getTarget(), "target is this");
            Assert.IsFalse(r.isSymbolic(), "not symbolic");
        }
Ejemplo n.º 2
0
        public void testConstructor_Peeled()
        {
            ObjectIdRef r;

            r = new Unpeeled(Storage.Loose, name, ID_A);
            Assert.AreSame(Storage.Loose, r.getStorage());
            Assert.AreSame(name, r.getName());
            Assert.AreSame(ID_A, r.getObjectId());
            Assert.IsFalse(r.isPeeled(), "not peeled");
            Assert.IsNull(r.getPeeledObjectId(), "no peel id");
            Assert.AreSame(r, r.getLeaf(), "leaf is this");
            Assert.AreSame(r, r.getTarget(), "target is this");
            Assert.IsFalse(r.isSymbolic(), "not symbolic");

            r = new PeeledNonTag(Storage.Loose, name, ID_A);
            Assert.IsTrue(r.isPeeled(), "is peeled");
            Assert.IsNull(r.getPeeledObjectId(), "no peel id");

            r = new PeeledTag(Storage.Loose, name, ID_A, ID_B);
            Assert.IsTrue(r.isPeeled(), "is peeled");
            Assert.AreSame(ID_B, r.getPeeledObjectId());
        }