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

Where_Array_ExecutionIsDeferred() private method

private Where_Array_ExecutionIsDeferred ( ) : void
return void
        public void Where_Array_ExecutionIsDeferred()
        {
            bool funcCalled = false;
            Func<bool>[] source = { () => { funcCalled = true; return true; } };

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

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