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

WhereWhere_ICollection_ExecutionIsDeferred() private method

private WhereWhere_ICollection_ExecutionIsDeferred ( ) : void
return void
        public void WhereWhere_ICollection_ExecutionIsDeferred()
        {
            bool funcCalled = false;
            ICollection<Func<bool>> source = new LinkedList<Func<bool>>(new List<Func<bool>>() { () => { funcCalled = true; return true; } });

            IEnumerable<Func<bool>> query = source.Where(value => value()).Where(value => value());
            Assert.False(funcCalled);

            query = source.Where((value, index) => value());
            Assert.False(funcCalled);
        }
WhereTests