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

WhereWhere_Array_ExecutionIsDefered() private method

private WhereWhere_Array_ExecutionIsDefered ( ) : void
return void
        public void WhereWhere_Array_ExecutionIsDefered()
        {
            bool funcCalled = false;
            Func<bool>[] source = new 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