diff --git a/test/RedisRateLimiting.Tests/UnitTests/ConcurrencyUnitTests.cs b/test/RedisRateLimiting.Tests/UnitTests/ConcurrencyUnitTests.cs index fed46f9..71e246d 100644 --- a/test/RedisRateLimiting.Tests/UnitTests/ConcurrencyUnitTests.cs +++ b/test/RedisRateLimiting.Tests/UnitTests/ConcurrencyUnitTests.cs @@ -55,7 +55,7 @@ public async Task ThrowsWhenAcquiringMoreThanLimit() [Fact] public async Task CanAcquireAsyncResource() { - await Fixture.ClearStatisticsAsync("Test_CanAcquireAsyncResource"); + await Fixture.ClearStatisticsAsync("cc", "Test_CanAcquireAsyncResource"); using var limiter = new RedisConcurrencyRateLimiter( "Test_CanAcquireAsyncResource", @@ -169,7 +169,7 @@ public async Task FailsWhenQueuingMoreThanLimit() [Fact] public async Task QueueAvailableAfterQueueLimitHitAndResourcesBecomeAvailable() { - await Fixture.ClearStatisticsAsync("Test_QueueAvailableAfterQueueLimitHitAndResourcesBecomeAvailable"); + await Fixture.ClearStatisticsAsync("cc", "Test_QueueAvailableAfterQueueLimitHitAndResourcesBecomeAvailable"); using var limiter = new RedisConcurrencyRateLimiter( "Test_QueueAvailableAfterQueueLimitHitAndResourcesBecomeAvailable", diff --git a/test/RedisRateLimiting.Tests/UnitTests/SlidingWindowUnitTests.cs b/test/RedisRateLimiting.Tests/UnitTests/SlidingWindowUnitTests.cs index c1bf730..c07fa49 100644 --- a/test/RedisRateLimiting.Tests/UnitTests/SlidingWindowUnitTests.cs +++ b/test/RedisRateLimiting.Tests/UnitTests/SlidingWindowUnitTests.cs @@ -71,7 +71,7 @@ public async Task ThrowsWhenAcquiringMoreThanLimit() [Fact] public async Task CanAcquireAsyncResource() { - await Fixture.ClearStatisticsAsync("Test_CanAcquireAsyncResource_SW"); + await Fixture.ClearStatisticsAsync("sw", "Test_CanAcquireAsyncResource_SW"); using var limiter = new RedisSlidingWindowRateLimiter( "Test_CanAcquireAsyncResource_SW", diff --git a/test/RedisRateLimiting.Tests/UnitTests/TestFixture.cs b/test/RedisRateLimiting.Tests/UnitTests/TestFixture.cs index 7405526..e1ec18c 100644 --- a/test/RedisRateLimiting.Tests/UnitTests/TestFixture.cs +++ b/test/RedisRateLimiting.Tests/UnitTests/TestFixture.cs @@ -23,9 +23,9 @@ public TestFixture() ConnectionMultiplexerFactory = () => ConnectionMultiplexer; } - public async Task ClearStatisticsAsync(string partitionKey) + public async Task ClearStatisticsAsync(string rl, string partitionKey) { - var key = $"rl:{{{partitionKey}}}:stats"; + var key = $"rl:{rl}:{{{partitionKey}}}:stats"; var database = ConnectionMultiplexer.GetDatabase(); await database.KeyDeleteAsync(key); }