예제 #1
0
파일: ConsTests.cs 프로젝트: ryrency/Misc
        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);
        }
예제 #2
0
        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();
        }