public void SeqIteratorResetAtBeginningWorks() { Cons c = new Cons(1, new Cons(2, null)); SeqEnumerator s = new SeqEnumerator(c); s.Reset(); Expect(s.MoveNext()); Expect(s.Current, EqualTo(1)); Expect(s.MoveNext()); Expect(s.Current, EqualTo(2)); Expect(s.Current, EqualTo(2)); Expect(s.MoveNext(), False); }
public void SeqIteratorResetAtBeginningWorks() { Cons c = new Cons(1, new Cons(2, null)); SeqEnumerator s = new SeqEnumerator(c); s.Reset(); Expect(s.MoveNext()); Expect(s.Current).To.Equal(1); Expect(s.MoveNext()); Expect(s.Current).To.Equal(2); Expect(s.Current).To.Equal(2); Expect(s.MoveNext()).To.Be.False(); }