public void ItShouldThrowOnCacheRegionWithDirectCacheRegionCall() { #pragma warning disable 618 Action act = () => LinqExtensionMethods.CacheRegion(Enumerable.Empty <PersonEntity>().AsQueryable(), "test").FirstOrDefault(); #pragma warning restore 618 act.Should() .Throw <NotSupportedException>() .WithMessage( "The query.Provider does not support setting options. Please implement IQueryProviderWithOptions."); }