public void EmptyReturnsEmptyCollection() { PersistentVector v = PersistentVector.create(1, 2, 3); IPersistentCollection e = v.empty(); Expect(e.count(), EqualTo(0)); }
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)); }
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(); }