System.Linq.Tests.SelectTests.SelectSelect_SourceIsIEnumerable_ExecutionIsDefered C# (CSharp) Méthode

SelectSelect_SourceIsIEnumerable_ExecutionIsDefered() private méthode

private SelectSelect_SourceIsIEnumerable_ExecutionIsDefered ( ) : void
Résultat void
        public void SelectSelect_SourceIsIEnumerable_ExecutionIsDefered()
        {
            bool funcCalled = false;
            IEnumerable<Func<int>> source = Enumerable.Repeat((Func<int>)(() => { funcCalled = true; return 1; }), 1);

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