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