A cons cell constructed lazily by a call to an IFn.
The 'first' is computed by calling f(). The 'rest' is computed by calling f(null).
Наследование: clojure.lang.ASeq
Пример #1
0
        public void Setup()
        {
            MockRepository mocks = new MockRepository();
            IPersistentMap meta = mocks.StrictMock<IPersistentMap>();
            IFn fn = mocks.StrictMock<IFn>();
            RMExpect.Call(fn.invoke()).Return(10);
            RMExpect.Call(fn.invoke(null)).Return(null);
            mocks.ReplayAll();

            _objWithNullMeta = new LazyCons(fn);
            _obj = _objWithNullMeta.withMeta(meta);
            _expectedType = typeof(LazyCons);

            mocks.VerifyAll();
        }
Пример #2
0
        public void CtorWorks()
        {
            LazyCons lc = new LazyCons(null);

            Expect(lc, Not.Null);
        }
Пример #3
0
 public void Setup()
 {
     _mocks = new MockRepository();
     _fn = _mocks.StrictMock<IFn>();
     RMExpect.Call(_fn.invoke()).Return(10);
     RMExpect.Call(_fn.invoke(null)).Return(new Cons(20,null));
     _lc = new LazyCons(_fn);
     _values = new object[] { 10, 20 };
     _mocks.ReplayAll();
 }