public void IndexOverflow() { var selected = new FastInfiniteEnumerator<int>().SelectMany((e, i) => Enumerable.Empty<int>()); using (var en = selected.GetEnumerator()) Assert.Throws<OverflowException>(() => { while(en.MoveNext()) { } }); }
public void IndexTakeWhileOverflowBeyondIntMaxValueElements() { var taken = new FastInfiniteEnumerator <int>().TakeWhile((e, i) => true); using (var en = taken.GetEnumerator()) Assert.Throws <OverflowException>(() => { while (en.MoveNext()) { } }); }
public void IndexSkipWhileOverflowBeyondIntMaxValueElements() { var skipped = new FastInfiniteEnumerator().SkipWhile((e, i) => true); using (var en = skipped.GetEnumerator()) Assert.Throws <OverflowException>(() => { while (en.MoveNext()) { } }); }
public void IndexOverflows() { var infiniteWhere = new FastInfiniteEnumerator <int>().Where((e, i) => true); using (var en = infiniteWhere.GetEnumerator()) Assert.Throws <OverflowException>(() => { while (en.MoveNext()) { } }); }