public void EmptyCopiesMeta()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentVector      v1 = PersistentVector.create(1, 2, 3);
            IPersistentCollection e1 = v1.empty();

            PersistentVector      v2 = (PersistentVector)v1.withMeta(meta);
            IPersistentCollection e2 = v2.empty();

            Expect(((IObj)e1).meta(), Null);
            Expect(((IObj)e2).meta(), SameAs(meta));
        }
        public void EmptyCopiesMeta()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentVector      v1 = PersistentVector.create(1, 2, 3);
            IPersistentCollection e1 = v1.empty();

            PersistentVector      v2 = (PersistentVector)v1.withMeta(meta);
            IPersistentCollection e2 = v2.empty();

            Expect(((IObj)e1).meta()).To.Be.Null();
            Expect(Object.ReferenceEquals(((IObj)e2).meta(), meta));
        }
示例#3
0
        public void EmptyCopiesMeta()
        {
            MockRepository mocks = new MockRepository();
            IPersistentMap meta  = mocks.StrictMock <IPersistentMap>();

            mocks.ReplayAll();

            PersistentVector      v1 = PersistentVector.create(1, 2, 3);
            IPersistentCollection e1 = v1.empty();

            PersistentVector      v2 = (PersistentVector)v1.withMeta(meta);
            IPersistentCollection e2 = v2.empty();

            Expect(((IObj)e1).meta(), Null);
            Expect(((IObj)e2).meta(), SameAs(meta));

            mocks.VerifyAll();
        }