10 references to AddPolicy
Microsoft.AspNetCore.RateLimiting.Tests (9)
RateLimitingMiddlewareTests.cs (8)
260
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey", 404, false));
291
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey", 404, true));
323
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey", 404, false));
355
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey", 404, false));
432
options.Value.
AddPolicy
<string>(endpointName1, new TestRateLimiterPolicy(duplicateKey, 404, false));
433
options.Value.
AddPolicy
<string>(endpointName2, new TestRateLimiterPolicy(duplicateKey, 400, false));
522
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey", 404, false));
593
options.Value.
AddPolicy
<string>(name, new TestRateLimiterPolicy("myKey2", 403, false));
RateLimitingOptionsTests.cs (1)
30
Assert.Throws<ArgumentNullException>(() => options.
AddPolicy
<string>("myKey", policy: null));
RateLimitingSample (1)
Program.cs (1)
34
.
AddPolicy
<string>(completeName, new SampleRateLimiterPolicy(NullLogger<SampleRateLimiterPolicy>.Instance))