Exemple #1
0
 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())
             {
             }
         });
 }
Exemple #2
0
        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())
                    {
                    }
                });
        }
Exemple #4
0
        public void IndexOverflows()
        {
            var infiniteWhere = new FastInfiniteEnumerator <int>().Where((e, i) => true);

            using (var en = infiniteWhere.GetEnumerator())
                Assert.Throws <OverflowException>(() =>
                {
                    while (en.MoveNext())
                    {
                    }
                });
        }