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 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 ReduceWithNoStartIterates() { MockRepository mocks = new MockRepository(); IFn fn = mocks.StrictMock <IFn>(); RMExpect.Call(fn.invoke(1, 2)).Return(5); RMExpect.Call(fn.invoke(5, 3)).Return(7); mocks.ReplayAll(); PersistentList p = (PersistentList)PersistentList.create(new object[] { 1, 2, 3 }); object ret = p.reduce(fn); Expect(ret, EqualTo(7)); mocks.VerifyAll(); }