Ejemplo n.º 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())
             {
             }
         });
 }
Ejemplo n.º 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())
                    {
                    }
                });
        }
Ejemplo n.º 3
0
        public void IndexSkipWhileOverflowBeyondIntMaxValueElements()
        {
            var skipped = new FastInfiniteEnumerator().SkipWhile((e, i) => true);

            using (var en = skipped.GetEnumerator())
                Assert.Throws <OverflowException>(() =>
                {
                    while (en.MoveNext())
                    {
                    }
                });
        }
Ejemplo n.º 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())
                    {
                    }
                });
        }