Exemplo n.º 1
0
        public void InvertedMapTest()
        {
            for (int i = 0; i < 10000; i++)
            {
                list.Add(i);
            }
            int count = 0;

            foreach (var el in list.Inverse().Map(n => n = n * 2))
            {
                Assert.AreEqual(list[list.Count - 1 - count] * 2, el);
                count++;
            }
        }
Exemplo n.º 2
0
        public void InverseTest()
        {
            list = new NSList <int> {
                1, 2, 3, 4
            };

            var expected = 4;

            foreach (var el in list.Inverse())
            {
                Assert.AreEqual(expected, el);
                expected--;
            }
            var result = new int[] { 0, 1, 2, 3, 4 };

            expected = 4;
            foreach (var el in result.Inverse())
            {
                Console.WriteLine(el);
                Assert.AreEqual(expected, el);
                expected--;
            }
        }