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

WhereWhere_IReadOnlyCollection_ReturnsExpectedValues() private method

        public void WhereWhere_IReadOnlyCollection_ReturnsExpectedValues()
        {
            IReadOnlyCollection<int> source = new ReadOnlyCollection<int>(new List<int> { 1, 2, 3, 4, 5 });
            Func<int, bool> evenPredicate = (value) => value % 2 == 0;

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

            Assert.Equal(2, result.Count());
            Assert.Equal(2, result.ElementAt(0));
            Assert.Equal(4, result.ElementAt(1));
        }
WhereTests