Skip to content

Commit

Permalink
Fix tests cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cristipufu committed Nov 16, 2023
1 parent d7e6ba2 commit 194cfae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(
"Test_CanAcquireAsyncResource",
Expand Down Expand Up @@ -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<string>(
"Test_QueueAvailableAfterQueueLimitHitAndResourcesBecomeAvailable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(
"Test_CanAcquireAsyncResource_SW",
Expand Down
4 changes: 2 additions & 2 deletions test/RedisRateLimiting.Tests/UnitTests/TestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 194cfae

Please sign in to comment.