Beispiel #1
0
        public void MetaCtorHasMeta()
        {
            IPersistentMap meta = new DummyMeta();
            Cons           c    = new Cons(meta, "abc", null);

            Expect(c.meta(), SameAs(meta));
        }
Beispiel #2
0
        public void MetaCtorHasMeta()
        {
            IPersistentMap meta = new DummyMeta();
            Cons           c    = new Cons(meta, "abc", null);

            Expect(Object.ReferenceEquals(c.meta(), meta));
        }
        public void Map_ctor_creates_with_given_metadata()
        {
            IPersistentMap meta = new DummyMeta();

            ConcreteAReference c = new ConcreteAReference(meta);
            Expect(c.meta(), SameAs(meta));
        }
        public void Meta_ctor_has_meta()
        {
            IPersistentMap meta = new DummyMeta();
            Range          r    = new Range(meta, 2, 5);

            Expect(r.meta(), EqualTo(meta));
        }
Beispiel #5
0
        public void Meta_ctor_has_meta()
        {
            IPersistentMap meta = new DummyMeta();
            IObj           r    = ((IObj)_createFn(2L, 5L)).withMeta(meta);

            Expect(r.meta(), EqualTo(meta));
        }
Beispiel #6
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            _objWithNullMeta = new MockObj();
            _obj             = new MockObj(meta);
            _expectedType    = typeof(MockObj);
        }
Beispiel #7
0
        public void Map_ctor_creates_with_given_metadata()
        {
            IPersistentMap meta = new DummyMeta();

            ConcreteAReference c = new ConcreteAReference(meta);

            Expect(c.meta(), SameAs(meta));
        }
Beispiel #8
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            _objWithNullMeta = new MockObj();
            _obj = new MockObj(meta);
            _expectedType = typeof(MockObj);
        }
Beispiel #9
0
        public void Cons_ISeq_with_meta_has_correct_values()
        {
            IPersistentMap meta = new DummyMeta();

            Cons c1 = new Cons("def", null);
            Cons c2 = new Cons(meta, "abc", c1);

            VerifyISeqContents(c2, new object[] { "abc", "def" });
        }
Beispiel #10
0
        public void CreateOnMetaNoArgsReturnsEmptyMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta);

            Expect(m.count()).To.Equal(0);
            Expect(Object.ReferenceEquals(m.meta(), meta));
        }
        public void EmptyPreservesMeta()
        {
            IPersistentMap meta = new DummyMeta();

            IPersistentCollection p = (IPersistentCollection)new PersistentList("abc").withMeta(meta);
            IObj obj = (IObj) p.empty();

            Expect(obj.meta(), SameAs(meta));
        }
        public void ResetMeta_sets_meta()
        {
            IPersistentMap meta = new DummyMeta();

            ConcreteAReference c = new ConcreteAReference();
            c.resetMeta(meta);

            Expect(c.meta(), EqualTo(meta));
        }
Beispiel #13
0
        public void CreateOnMetaNoArgsReturnsEmptyMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta);

            Expect(m.count(), EqualTo(0));
            Expect(m.meta(), SameAs(meta));
        }
        public void EmptyPreservesMeta()
        {
            IPersistentMap meta = new DummyMeta();

            IPersistentCollection p = (IPersistentCollection) new PersistentList("abc").withMeta(meta);
            IObj obj = (IObj)p.empty();

            Expect(Object.ReferenceEquals(obj.meta(), meta));
        }
Beispiel #15
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Symbol sym1 = Symbol.intern("def", "abc");

            _objWithNullMeta = (IObj)sym1;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(Symbol);
        }
        public void AlterMeta_changes_meta()
        {
            IPersistentMap meta = new DummyMeta();
            IFn fn = DummyFn.CreateForMetaAlter(meta);

            ConcreteAReference c = new ConcreteAReference();
            c.alterMeta(fn, null);

            Expect(c.meta(), SameAs(meta));
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentTreeSet m = PersistentTreeSet.create(RT.seq(PersistentVector.create("a", "b")));

            _objWithNullMeta = (IObj)m;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentTreeSet);
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            StringSeq s = StringSeq.create("abcde");

            _objWithNullMeta = (IObj)s;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(StringSeq);
        }
Beispiel #19
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentTreeSet m = PersistentTreeSet.create(RT.seq(PersistentVector.create("a", "b")));

            _objWithNullMeta = (IObj)m;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentTreeSet);
        }
Beispiel #20
0
        public void ResetMeta_sets_meta()
        {
            IPersistentMap meta = new DummyMeta();

            ConcreteAReference c = new ConcreteAReference();

            c.resetMeta(meta);

            Expect(c.meta(), EqualTo(meta));
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Range r = new Range(2, 5);

            _objWithNullMeta = (IObj)r;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(Range);
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            StringSeq s = StringSeq.create("abcde");

            _objWithNullMeta = (IObj)s;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(StringSeq);
        }
Beispiel #23
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            LongRange r = (LongRange)LongRange.create(2L, 5L);

            _objWithNullMeta = (IObj)r;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(LongRange);
        }
        public void RSeqWithMetaHasMeta()
        {
            IPersistentMap meta = new DummyMeta();

            CPV  v   = new CPV(new object[] { 4, 5, 6 });
            IObj s   = (IObj)v.rseq();
            IObj obj = s.withMeta(meta);

            Expect(obj.meta(), SameAs(meta));
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentList p1 = (PersistentList)PersistentList.create(new object[] { "abc", "def" });

            _objWithNullMeta = (IObj)p1;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentList);
        }
Beispiel #26
0
        public void SeqWithMetaHasMeta()
        {
            IPersistentMap meta = new DummyMeta();

            CPV  v   = new CPV(new object[] { 4, 5, 6 });
            IObj s   = (IObj)v.seq();
            IObj obj = s.withMeta(meta);

            Expect(Object.ReferenceEquals(obj.meta(), meta));
        }
Beispiel #27
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(1, "a", 2, "b");

            _testNoChange    = false;
            _objWithNullMeta = (IObj)m;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentHashMap);
        }
Beispiel #28
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashSet m = PersistentHashSet.create(1, "a", 2, "b");


            _objWithNullMeta = (IObj)m;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentHashSet);
        }
Beispiel #29
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Cons c1 = new Cons("abc", null);
            Cons c2 = new Cons(meta, "def", c1);

            _obj             = c2;
            _objWithNullMeta = c1;
            _expectedType    = typeof(Cons);
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentVector v = PersistentVector.create(2, 3, 4);

            _testNoChange    = false;
            _objWithNullMeta = (IObj)v;
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentVector);
        }
Beispiel #31
0
        public void AlterMeta_changes_meta()
        {
            IPersistentMap meta = new DummyMeta();
            IFn            fn   = DummyFn.CreateForMetaAlter(meta);

            ConcreteAReference c = new ConcreteAReference();

            c.alterMeta(fn, null);

            Expect(c.meta(), SameAs(meta));
        }
Beispiel #32
0
        public void CreateOnMetaNoArgsReturnsMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta, 1, "a", 2, "b");

            Expect(m.count(), EqualTo(2));
            Expect(m.valAt(1), EqualTo("a"));
            Expect(m.valAt(2), EqualTo("b"));
            Expect(m.containsKey(3), False);
            Expect(m.meta(), SameAs(meta));
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Dictionary <int, string> d = new Dictionary <int, string>();

            d[1] = "abc";

            _objWithNullMeta = (IObj)PersistentArrayMap.create(d);
            _obj             = _objWithNullMeta.withMeta(meta);
            _expectedType    = typeof(PersistentArrayMap);
        }
Beispiel #34
0
        public void CreateOnMetaNoArgsReturnsMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta, 1, "a", 2, "b");

            Expect(m.count()).To.Equal(2);
            Expect(m.valAt(1)).To.Equal("a");
            Expect(m.valAt(2)).To.Equal("b");
            Expect(m.containsKey(3)).To.Be.False();
            Expect(Object.ReferenceEquals(m.meta(), 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(), 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 Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(1, "a", 2, "b");

            _testNoChange = false;
            _objWithNullMeta = (IObj)m;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentHashMap);
        }
        public void SeqWithMetaHasMeta()
        {
            IPersistentMap meta = new DummyMeta();

            CPV v = new CPV(new object[] { 4, 5, 6 });
            IObj s = (IObj)v.seq();
            IObj obj = s.withMeta(meta);

            Expect(obj.meta(), SameAs(meta));
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashSet m = PersistentHashSet.create(1, "a", 2, "b");


            _objWithNullMeta = (IObj)m;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentHashSet);
        }
Beispiel #40
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            LongRange r = (LongRange)LongRange.create(2L, 5L);

            _objWithNullMeta = (IObj)r;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(LongRange);
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentList p1 = (PersistentList)PersistentList.create(new object[] { "abc", "def" });

            _objWithNullMeta = (IObj)p1;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentList);
        }
Beispiel #42
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Symbol sym1 = Symbol.intern("def", "abc");

            _objWithNullMeta = (IObj)sym1;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(Symbol);
        }
Beispiel #43
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Cons c1 = new Cons("abc", null);
            Cons c2 = new Cons(meta,"def", c1);
            _obj = c2;
            _objWithNullMeta = c1;
            _expectedType = typeof(Cons);
        }
        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));
        }
Beispiel #45
0
 public void Meta_ctor_has_meta()
 {
     IPersistentMap meta = new DummyMeta();
     IObj r = ((IObj)_createFn(2L, 5L)).withMeta(meta);
     Expect(r.meta(), EqualTo(meta));
 }
        public void CreateOnMetaNoArgsReturnsMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta,1, "a", 2, "b");

            Expect(m.count(), EqualTo(2));
            Expect(m.valAt(1), EqualTo("a"));
            Expect(m.valAt(2), EqualTo("b"));
            Expect(m.containsKey(3), False);
            Expect(m.meta(), SameAs(meta));
        }
Beispiel #47
0
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Range r = new Range(2, 5);

            _objWithNullMeta = (IObj)r;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(Range);
        }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            Dictionary<int, string> d = new Dictionary<int, string>();
            d[1] = "abc";

            _objWithNullMeta = (IObj)PersistentArrayMap.create(d);
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentArrayMap);
        }
Beispiel #49
0
 public void Meta_ctor_has_meta()
 {
     IPersistentMap meta = new DummyMeta();
     Range r = new Range(meta, 2, 5);
     Expect(r.meta(), EqualTo(meta));
 }
        public void CreateOnMetaNoArgsReturnsEmptyMap()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentHashMap m = PersistentHashMap.create(meta);

            Expect(m.count(), EqualTo(0));
            Expect(m.meta(), SameAs(meta));
        }
Beispiel #51
0
 public void MetaCtorHasMeta()
 {
     IPersistentMap meta = new DummyMeta();
     Cons c = new Cons(meta, "abc", null);
     Expect(c.meta(), SameAs(meta));
 }
        public void Setup()
        {
            IPersistentMap meta = new DummyMeta();

            PersistentVector v = PersistentVector.create(2, 3, 4);

            _testNoChange = false;
            _objWithNullMeta = (IObj)v;
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(PersistentVector);
        }
Beispiel #53
0
        public void Cons_ISeq_with_meta_has_correct_values()
        {
            IPersistentMap meta = new DummyMeta();

            Cons c1 = new Cons("def", null);
            Cons c2 = new Cons(meta,"abc", c1);

            VerifyISeqContents(c2, new object[] { "abc", "def" });
        }