232 references to TestUtils
Microsoft.AspNetCore.ResponseCaching.Tests (232)
ResponseCachingKeyProviderTests.cs (26)
16var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 17var context = TestUtils.CreateTestContext(); 31var cacheKeyProvider = TestUtils.CreateTestKeyProvider(new ResponseCachingOptions() 35var context = TestUtils.CreateTestContext(); 45var cacheKeyProvider = TestUtils.CreateTestKeyProvider(new ResponseCachingOptions() 49var context = TestUtils.CreateTestContext(); 59var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 60var context = TestUtils.CreateTestContext(); 68var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 69var context = TestUtils.CreateTestContext(); 81var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 82var context = TestUtils.CreateTestContext(); 97var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 98var context = TestUtils.CreateTestContext(); 113var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 114var context = TestUtils.CreateTestContext(); 129var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 130var context = TestUtils.CreateTestContext(); 145var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 146var context = TestUtils.CreateTestContext(); 163var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 164var context = TestUtils.CreateTestContext(); 181var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 182var context = TestUtils.CreateTestContext(); 199var cacheKeyProvider = TestUtils.CreateTestKeyProvider(); 200var context = TestUtils.CreateTestContext();
ResponseCachingMiddlewareTests.cs (90)
22var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider()); 23var context = TestUtils.CreateTestContext(); 31TestUtils.AssertLoggedMessages( 41var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey")); 42var context = TestUtils.CreateTestContext(); 46TestUtils.AssertLoggedMessages( 56var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey")); 57var context = TestUtils.CreateTestContext(); 70TestUtils.AssertLoggedMessages( 80var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey")); 81var context = TestUtils.CreateTestContext(); 99TestUtils.AssertLoggedMessages( 109var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey", "VaryKey")); 110var context = TestUtils.CreateTestContext(); 119TestUtils.AssertLoggedMessages( 129var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey", new[] { "VaryKey", "VaryKey2" })); 130var context = TestUtils.CreateTestContext(); 147TestUtils.AssertLoggedMessages( 157var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache, keyProvider: new TestResponseCachingKeyProvider("BaseKey")); 158var context = TestUtils.CreateTestContext(); 171TestUtils.AssertLoggedMessages( 180var context = TestUtils.CreateTestContext(sink); 192var context = TestUtils.CreateTestContext(sink); 212TestUtils.AssertLoggedMessages( 223var context = TestUtils.CreateTestContext(sink); 246TestUtils.AssertLoggedMessages( 257var context = TestUtils.CreateTestContext(sink); 266TestUtils.AssertLoggedMessages( 276var context = TestUtils.CreateTestContext(sink); 292var context = TestUtils.CreateTestContext(sink); 319var context = TestUtils.CreateTestContext(sink); 325TestUtils.AssertLoggedMessages( 334var context = TestUtils.CreateTestContext(sink); 347var context = TestUtils.CreateTestContext(sink); 353TestUtils.AssertLoggedMessages( 362var middleware = TestUtils.CreateTestMiddleware(options: new ResponseCachingOptions 366var context = TestUtils.CreateTestContext(); 378var middleware = TestUtils.CreateTestMiddleware(options: new ResponseCachingOptions 382var context = TestUtils.CreateTestContext(); 400var middleware = TestUtils.CreateTestMiddleware(testSink: sink, policyProvider: new ResponseCachingPolicyProvider()); 401var context = TestUtils.CreateTestContext(); 420var middleware = TestUtils.CreateTestMiddleware(testSink: sink, policyProvider: new ResponseCachingPolicyProvider()); 421var context = TestUtils.CreateTestContext(); 435var middleware = TestUtils.CreateTestMiddleware(testSink: sink); 436var context = TestUtils.CreateTestContext(); 452var middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions 456var context = TestUtils.CreateTestContext(); 472var middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions 476var context = TestUtils.CreateTestContext(); 497var middleware = TestUtils.CreateTestMiddleware(testSink: sink, options: new ResponseCachingOptions 501var context = TestUtils.CreateTestContext(); 522var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 523var context = TestUtils.CreateTestContext(); 541TestUtils.AssertLoggedMessages( 551var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 552var context = TestUtils.CreateTestContext(); 572TestUtils.AssertLoggedMessages( 601var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 602var context = TestUtils.CreateTestContext(); 622var middleware = TestUtils.CreateTestMiddleware(testSink: sink); 623var context = TestUtils.CreateTestContext(); 640var middleware = TestUtils.CreateTestMiddleware(testSink: sink); 641var context = TestUtils.CreateTestContext(); 658var middleware = TestUtils.CreateTestMiddleware(testSink: sink); 659var context = TestUtils.CreateTestContext(); 673var middleware = TestUtils.CreateTestMiddleware(testSink: sink); 674var context = TestUtils.CreateTestContext(); 681TestUtils.AssertLoggedMessages( 691var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 692var context = TestUtils.CreateTestContext(); 707TestUtils.AssertLoggedMessages( 719var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 720var context = TestUtils.CreateTestContext(); 736TestUtils.AssertLoggedMessages( 748var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 749var context = TestUtils.CreateTestContext(); 769TestUtils.AssertLoggedMessages( 779var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 780var context = TestUtils.CreateTestContext(); 797TestUtils.AssertLoggedMessages( 807var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 808var context = TestUtils.CreateTestContext(); 817TestUtils.AssertLoggedMessages( 827var middleware = TestUtils.CreateTestMiddleware(testSink: sink, cache: cache); 828var context = TestUtils.CreateTestContext(); 839TestUtils.AssertLoggedMessages( 848var middleware = TestUtils.CreateTestMiddleware( 855var context = TestUtils.CreateTestContext(); 868TestUtils.AssertLoggedMessages( 906var middleware = TestUtils.CreateTestMiddleware(next: httpContext =>
ResponseCachingPolicyProviderTests.cs (61)
29var context = TestUtils.CreateTestContext(sink); 58var context = TestUtils.CreateTestContext(sink); 62TestUtils.AssertLoggedMessages( 71var context = TestUtils.CreateTestContext(sink); 76TestUtils.AssertLoggedMessages( 85var context = TestUtils.CreateTestContext(sink); 100var context = TestUtils.CreateTestContext(sink); 108TestUtils.AssertLoggedMessages( 117var context = TestUtils.CreateTestContext(sink); 122TestUtils.AssertLoggedMessages( 131var context = TestUtils.CreateTestContext(sink); 144var context = TestUtils.CreateTestContext(sink); 159var context = TestUtils.CreateTestContext(sink); 162TestUtils.AssertLoggedMessages( 171var context = TestUtils.CreateTestContext(sink); 185var context = TestUtils.CreateTestContext(sink); 193TestUtils.AssertLoggedMessages( 202var context = TestUtils.CreateTestContext(sink); 210TestUtils.AssertLoggedMessages( 219var context = TestUtils.CreateTestContext(sink); 227TestUtils.AssertLoggedMessages( 236var context = TestUtils.CreateTestContext(sink); 244TestUtils.AssertLoggedMessages( 253var context = TestUtils.CreateTestContext(sink); 261TestUtils.AssertLoggedMessages( 271var context = TestUtils.CreateTestContext(sink); 347var context = TestUtils.CreateTestContext(sink); 355TestUtils.AssertLoggedMessages( 364var context = TestUtils.CreateTestContext(sink); 383var context = TestUtils.CreateTestContext(sink); 396TestUtils.AssertLoggedMessages( 406var context = TestUtils.CreateTestContext(sink); 426var context = TestUtils.CreateTestContext(sink); 438TestUtils.AssertLoggedMessages( 448var context = TestUtils.CreateTestContext(sink); 468var context = TestUtils.CreateTestContext(sink); 480TestUtils.AssertLoggedMessages( 490var context = TestUtils.CreateTestContext(sink); 504var context = TestUtils.CreateTestContext(sink); 522var context = TestUtils.CreateTestContext(sink); 533TestUtils.AssertLoggedMessages( 543var context = TestUtils.CreateTestContext(sink); 563var context = TestUtils.CreateTestContext(sink); 575TestUtils.AssertLoggedMessages( 585var context = TestUtils.CreateTestContext(sink); 606var context = TestUtils.CreateTestContext(sink); 619TestUtils.AssertLoggedMessages( 628var context = TestUtils.CreateTestContext(sink); 642TestUtils.AssertLoggedMessages( 652var context = TestUtils.CreateTestContext(sink); 665TestUtils.AssertLoggedMessages( 674var context = TestUtils.CreateTestContext(sink); 689TestUtils.AssertLoggedMessages( 698var context = TestUtils.CreateTestContext(sink); 712TestUtils.AssertLoggedMessages( 721var context = TestUtils.CreateTestContext(sink); 736TestUtils.AssertLoggedMessages( 745var context = TestUtils.CreateTestContext(sink); 761TestUtils.AssertLoggedMessages( 770var context = TestUtils.CreateTestContext(sink); 786TestUtils.AssertLoggedMessages(
ResponseCachingTests.cs (55)
18var builders = TestUtils.CreateBuildersWithResponseCaching(); 29var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 30var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 42var builders = TestUtils.CreateBuildersWithResponseCaching(); 53var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 54var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "different")); 64var builders = TestUtils.CreateBuildersWithResponseCaching(); 86var builders = TestUtils.CreateBuildersWithResponseCaching(); 108var builders = TestUtils.CreateBuildersWithResponseCaching(); 132var builders = TestUtils.CreateBuildersWithResponseCaching(); 144var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 147var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 153var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 165var builders = TestUtils.CreateBuildersWithResponseCaching(); 177var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 180var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 186var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 198var builders = TestUtils.CreateBuildersWithResponseCaching(); 209var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "path")); 210var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "PATH")); 222var builders = TestUtils.CreateBuildersWithResponseCaching(); 233var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "?Expires=0")); 234var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 246var builders = TestUtils.CreateBuildersWithResponseCaching(); 258var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 259var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "")); 269var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.Vary = HeaderNames.From); 292var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.Vary = HeaderNames.From); 316var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "query" }); 338var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryA", "queryb" }); 360var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" }); 382var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryB", "QueryA" }); 404var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" }); 426var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "query" }); 448var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryA", "QueryB" }); 470var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" }); 492var builders = TestUtils.CreateBuildersWithResponseCaching(); 518var builders = TestUtils.CreateBuildersWithResponseCaching(); 545var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.SetCookie = "cookieName=cookieValue"); 567var builders = TestUtils.CreateBuildersWithResponseCaching(); 593var builders = TestUtils.CreateBuildersWithResponseCaching(); 619var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.CacheControl = CacheControlHeaderValue.NoStoreString); 641var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => 671var builders = TestUtils.CreateBuildersWithResponseCaching(); 694var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => 724var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\"")); 747var builders = TestUtils.CreateBuildersWithResponseCaching(options: new ResponseCachingOptions() 772var builders = TestUtils.CreateBuildersWithResponseCaching(options: new ResponseCachingOptions() 797var builders = TestUtils.CreateBuildersWithResponseCaching(options: new ResponseCachingOptions() 822var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.Vary = HeaderNames.From); 848var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.Vary = context.Request.Headers.Pragma); 883var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.Headers.Vary = context.Request.Headers.Pragma); 918var builders = TestUtils.CreateBuildersWithResponseCaching(); 929var initialResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10")); 930var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10"));