public async Task NoLookupPolicy_DisablesLookup() { IOutputCachePolicy policy = NoLookupPolicy.Instance; var context = TestUtils.CreateUninitializedContext(); await policy.CacheRequestAsync(context, default); Assert.False(context.AllowCacheLookup); }
public async Task LockingPolicy_DisablesLocking() { IOutputCachePolicy policy = LockingPolicy.Disabled; var context = TestUtils.CreateUninitializedContext(); await policy.CacheRequestAsync(context, default); Assert.False(context.AllowLocking); }
public async Task DefaultCachePolicy_VariesByStar() { IOutputCachePolicy policy = DefaultPolicy.Instance; var context = TestUtils.CreateUninitializedContext(); await policy.CacheRequestAsync(context, default); Assert.Equal("*", context.CacheVaryByRules.QueryKeys); }
public async Task DefaultCachePolicy_AllowsLocking() { IOutputCachePolicy policy = DefaultPolicy.Instance; var context = TestUtils.CreateUninitializedContext(); await policy.CacheRequestAsync(context, default); Assert.True(context.AllowLocking); }
public async Task EnableCachePolicy_DisablesCache() { IOutputCachePolicy policy = EnableCachePolicy.Disabled; var context = TestUtils.CreateUninitializedContext(); context.EnableOutputCaching = true; await policy.CacheRequestAsync(context, default); Assert.False(context.EnableOutputCaching); }