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

SelectSelect_SourceIsAList_ReturnsExpectedValues() private method

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

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

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

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