System.Linq.Tests.SelectTests.Select_SourceIsAList_ExecutionIsDeferred C# (CSharp) Method

Select_SourceIsAList_ExecutionIsDeferred() private method

private Select_SourceIsAList_ExecutionIsDeferred ( ) : void
return void
        public void Select_SourceIsAList_ExecutionIsDeferred()
        {
            bool funcCalled = false;
            List<Func<int>> source = new List<Func<int>>() { () => { funcCalled = true; return 1; } };

            IEnumerable<int> query = source.Select(d => d());
            Assert.False(funcCalled);
        }
SelectTests