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