System.Linq.Tests.SelectTests.SelectSelect_SourceIsAnArray_ReturnsExpectedValues C# (CSharp) Méthode

SelectSelect_SourceIsAnArray_ReturnsExpectedValues() private méthode

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

            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.Length, index);
        }
SelectTests