Пример #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())
                    {
                    }
                });
        }
Пример #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())
                    {
                    }
                });
        }
Пример #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())
                    {
                    }
                });
        }
Пример #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())
             {
             }
         });
 }
Пример #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())
                    {

                    }
                });
        }
Пример #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())
             {
             }
         });
 }