System.Linq.Tests.WhereTests.Where_IReadOnlyCollection_ReturnsExpectedValues_True C# (CSharp) Method

Where_IReadOnlyCollection_ReturnsExpectedValues_True() private method

        public void Where_IReadOnlyCollection_ReturnsExpectedValues_True()
        {
            IReadOnlyCollection<int> source = new ReadOnlyCollection<int>(new List<int> { 1, 2, 3, 4, 5 });
            Func<int, bool> truePredicate = (value) => true;

            IEnumerable<int> result = source.Where(truePredicate);

            Assert.Equal(source.Count, result.Count());
            for (int i = 0; i < source.Count; i++)
            {
                Assert.Equal(source.ElementAt(i), result.ElementAt(i));
            }
        }
WhereTests