Example #1
0
        public void ElementAt()
        {
            var a = new CachedSequence <int> (1);
            var b = new CachedSequence <int> (2, a);
            var c = new CachedSequence <int> (3, b);
            var d = new CachedSequence <int> (4, c);

            Assert.AreEqual(4, d.Count());
            Assert.AreEqual(4, d.ElementAt(0));
            Assert.AreEqual(3, d.ElementAt(1));
            Assert.AreEqual(2, d.ElementAt(2));
            Assert.AreEqual(1, d.ElementAt(3));
        }
Example #2
0
        public void ElementAt_NegativeIndex()
        {
            CachedSequence <int> c = new CachedSequence <int> (42);

            c.ElementAt(-1);
        }
Example #3
0
        public void ElementAt_TooLarge()
        {
            CachedSequence <int> c = new CachedSequence <int> (42);

            c.ElementAt(2);
        }