System.Linq.Tests.LastTests.EmptySourcePredicate C# (CSharp) Method

EmptySourcePredicate() private method

private EmptySourcePredicate ( ) : void
return void
        public void EmptySourcePredicate()
        {
            IQueryable<int> source = Enumerable.Empty<int>().AsQueryable();

            Assert.Throws<InvalidOperationException>(() => source.Last(x => true));
            Assert.Throws<InvalidOperationException>(() => source.Last(x => false));
        }