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

            using (var en = infiniteWhere.GetEnumerator())
                Assert.Throws <OverflowException>(() =>
                {
                    while (en.MoveNext())
                    {
                    }
                });
        }
Example #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())
             {
             }
         });
 }
Example #5
0
        public void Overflow()
        {
            var selected = new FastInfiniteEnumerator<int>().Select((e, i) => e);
            using (var en = selected.GetEnumerator())
                Assert.Throws<OverflowException>(() =>
                {
                    while (en.MoveNext())
                    {

                    }
                });
        }
Example #6
0
 public void IndexTakeWhileOverflowBeyondIntMaxValueElements()
 {
     var taken = new FastInfiniteEnumerator<int>().TakeWhile((e, i) => true);
     
     using(var en = taken.GetEnumerator())
         Assert.Throws<OverflowException>(() =>
         {
             while(en.MoveNext())
             {
             }
         });
 }