public void OvershootIndexOnList()
        {
            IEnumerable <int> source = new NonEnumerableList <int> {
                90, 91, 92
            };

            Assert.AreEqual(0, source.ElementAtOrDefault(3));
        }
        public void OvershootIndexOnList()
        {
            IEnumerable <int> source = new NonEnumerableList <int> {
                90, 91, 92
            };

            Assert.Throws <ArgumentOutOfRangeException>(() => source.ElementAt(3));
        }
        public void ValidIndexOnList()
        {
            IEnumerable <int> source = new NonEnumerableList <int>(100, 56, 93, 22);

            Assert.AreEqual(93, source.ElementAt(2));
        }
Esempio n. 4
0
        public void ListWithPredicateStillIterates()
        {
            var source = new NonEnumerableList <int>(1, 5, 10, 3);

            Assert.Throws <NotSupportedException>(() => source.LastOrDefault(x => x > 3));
        }
Esempio n. 5
0
        public void ListWithoutPredicateDoesntIterate()
        {
            var source = new NonEnumerableList <int>(1, 5, 10, 3);

            Assert.AreEqual(3, source.LastOrDefault());
        }
 public void ListWithoutPredicateDoesntIterate()
 {
     var source = new NonEnumerableList<int>(1, 5, 10, 3);
     Assert.AreEqual(3, source.Last());
 }
Esempio n. 7
0
 public void ValidIndexOnList()
 {
     IEnumerable<int> source = new NonEnumerableList<int>(100, 56, 93, 22);
     Assert.AreEqual(93, source.ElementAt(2));
 }
Esempio n. 8
0
 public void OvershootIndexOnList()
 {
     IEnumerable<int> source = new NonEnumerableList<int> { 90, 91, 92 };
     Assert.Throws<ArgumentOutOfRangeException>(() => source.ElementAt(3));
 }
 public void ListWithPredicateStillIterates()
 {
     var source = new NonEnumerableList<int>(1, 5, 10, 3);
     Assert.Throws<NotSupportedException>(() => source.Last(x => x > 3));
 }
Esempio n. 10
0
 public void OvershootIndexOnList()
 {
     IEnumerable<int> source = new NonEnumerableList<int> { 90, 91, 92 };
     Assert.AreEqual(0, source.ElementAtOrDefault(3));
 }
Esempio n. 11
0
        public void ListWithPredicateStillIterates()
        {
            var source = new NonEnumerableList <int>(new[] { 1, 2, 3 });

            Assert.Throws <NotSupportedException>(() => source.Last(x => x > 2));
        }
Esempio n. 12
0
        public void ListWithoutPredicateDoesntIterate()
        {
            var source = new NonEnumerableList <int>(new[] { 1, 2, 3 });

            Assert.AreEqual(3, source.Last());
        }