System.Linq.Tests.WhereTests.Where_ICollection_ExecutionIsDeferred C# (CSharp) 메소드

Where_ICollection_ExecutionIsDeferred() 개인적인 메소드

private Where_ICollection_ExecutionIsDeferred ( ) : void
리턴 void
        public void Where_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());
            Assert.False(funcCalled);

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