Пример #1
0
        public void MapTest()
        {
            // Given
            var a = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

            // When
            var b = a.Map(x => x.ToString());
            var c = a.Map(x => System.Math.Sqrt(x));

            // Then
            Assert.AreEqual(b.Length, a.Length);
            Assert.AreEqual(c.Length, a.Length);
            Assert.AreEqual("1", b[0]);
            Assert.AreEqual(3, c[c.Length - 1]);
        }