public void ReduceWithNoStartIterates() { IFn fn = DummyFn.CreateForReduce(); IReduce r = (IReduce)_createFn(2L, 5L); object ret = r.reduce(fn); Expect(ret, EqualTo(9)); }
public void ReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); Range r = new Range(2, 5); object ret = r.reduce(fn, 20); Expect(ret, EqualTo(29)); }
public void ReduceWithNoStartIterates() { IFn fn = DummyFn.CreateForReduce(); IReduce r = (IReduce)_createFn(2L, 5L); object ret = r.reduce(fn); Expect(ret).To.Be.An.Instance.Of <long>(); Expect((long)ret).To.Equal(9); }
public void ReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); PersistentList p = (PersistentList)PersistentList.create(new object[] { 1, 2, 3 }); object ret = p.reduce(fn, 20); Expect(ret, EqualTo(26)); }
public void RSeqReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); CPV v = new CPV(new object[] { 1, 2, 3 }); IReduce r = (IReduce)v.rseq(); object ret = r.reduce(fn, 20); Expect(ret, EqualTo(26)); }
public void ReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); object[] array = new object[] { 2, 3, 4 }; IArraySeq a = ArraySeq.create(array); object ret = a.reduce(fn, 20); Expect(ret, EqualTo(29)); }
public void ReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); PersistentList p = (PersistentList)PersistentList.create(new object[] { 1, 2, 3 }); object ret = p.reduce(fn, 20); Expect(ret).To.Be.An.Instance.Of <long>(); Expect((long)ret).To.Equal(26); }
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 ReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); object[] array = new object[] { 2, 3, 4 }; IArraySeq a = ArraySeq.create(array); object ret = a.reduce(fn, 20); Expect(ret).To.Be.An.Instance.Of <long>(); Expect((long)ret).To.Equal(29); }
public void RSeqReduceWithStartIterates() { IFn fn = DummyFn.CreateForReduce(); CPV v = new CPV(new object[] { 1, 2, 3 }); IReduce r = (IReduce)v.rseq(); object ret = r.reduce(fn, 20); Expect(ret).To.Be.An.Instance.Of <long>(); Expect((long)ret).To.Equal(26); }