save checkpoint
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using FluentAssertions;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StellaOps.Router.Gateway.RateLimit;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Router.Gateway.Tests.RateLimit;
|
||||
|
||||
[Trait("Category", "Unit")]
|
||||
public sealed class RateLimitServiceCollectionExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void AddRouterRateLimiting_WithoutRules_RegistersNoOpRateLimitService()
|
||||
{
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.AddInMemoryCollection(new Dictionary<string, string?>())
|
||||
.Build();
|
||||
|
||||
var services = new ServiceCollection();
|
||||
services.AddLogging();
|
||||
|
||||
services.AddRouterRateLimiting(configuration);
|
||||
|
||||
using var provider = services.BuildServiceProvider();
|
||||
|
||||
provider.GetService<RateLimitService>().Should().NotBeNull();
|
||||
provider.GetService<InstanceRateLimiter>().Should().BeNull();
|
||||
provider.GetService<EnvironmentRateLimiter>().Should().BeNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user