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

Select_SourceIsIReadOnlyCollection_ExecutionIsDeferred() private method

        public void Select_SourceIsIReadOnlyCollection_ExecutionIsDeferred()
        {
            bool funcCalled = false;
            IReadOnlyCollection<Func<int>> source = new ReadOnlyCollection<Func<int>>(new List<Func<int>>() { () => { funcCalled = true; return 1; } });

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