System.Linq.Tests.SelectTests.Select_SourceIsAnArray_ReturnsExpectedValues C# (CSharp) Method

Select_SourceIsAnArray_ReturnsExpectedValues() private method

private Select_SourceIsAnArray_ReturnsExpectedValues ( ) : void
return void
        public void Select_SourceIsAnArray_ReturnsExpectedValues()
        {
            int[] source = new[] { 1, 2, 3, 4, 5 };
            Func<int, int> selector = i => i + 1;

            IEnumerable<int> query = source.Select(selector);

            int index = 0;
            foreach (var item in query)
            {
                var expected = selector(source[index]);
                Assert.Equal(expected, item);
                index++;
            }

            Assert.Equal(source.Length, index);
        }
SelectTests