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

Select_SourceIsAList_ReturnsExpectedValues() private method

private Select_SourceIsAList_ReturnsExpectedValues ( ) : void
return void
        public void Select_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);

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

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