Ejemplo n.º 1
0
        public void TakeLastEntireSequence()
        {
            var sequence = new EnumerableMonitor <int>(Enumerable.Range(1, 3));

            CollectionAssert.AreEqual(new[] { 1, 2, 3 }, sequence.TakeLast(5));
            Assert.AreEqual(3, sequence.RequestCount);
        }
Ejemplo n.º 2
0
        public void TakeLastPartialSequence()
        {
            var sequence = new EnumerableMonitor <int>(Enumerable.Range(1, 100));

            CollectionAssert.AreEqual(new[] { 98, 99, 100 }, sequence.TakeLast(3));
            Assert.AreEqual(100, sequence.RequestCount);
        }