/// <summary> /// Construct a <see cref="MapEnumerator">MapEnumerator</see> from a persistent map. /// </summary> /// <param name="map">The map to iterate over.</param> public MapEnumerator(IPersistentMap map) { _seqEnum = new SeqEnumerator(map.seq()); }
public void SeqIteratorResetAtEndWorks() { Cons c = new Cons(1, new Cons(2, null)); SeqEnumerator s = new SeqEnumerator(c); s.MoveNext(); s.MoveNext(); s.MoveNext(); 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 SeqIteratorMovedToEmptyHasNoCurrent() { Cons c = new Cons(1, new Cons(2, null)); SeqEnumerator s = new SeqEnumerator(c); s.MoveNext(); s.MoveNext(); s.MoveNext(); // Have to assign to access object o = s.Current; }
public void SeqIteratorOnEmptyHasNoCurrent() { SeqEnumerator s = new SeqEnumerator(null); // Have to assign to access object o = s.Current; }
public void SeqIteratorOnEmptySeqGoesNowhere() { SeqEnumerator s = new SeqEnumerator(null); Expect(s.MoveNext(), False); }
public void SeqIteratorOnEmptyHasNoCurrent() { SeqEnumerator s = new SeqEnumerator(null); object o = s.Current; }