Skip to content

Commit

Permalink
Fix non-generic rate-limit tests to be genuinely non-generic
Browse files Browse the repository at this point in the history
  • Loading branch information
reisenberger committed Jul 16, 2019
1 parent daa42cb commit c916be5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Polly.Specs/RateLimit/AsyncRateLimitPolicySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public void Dispose()

protected override IRateLimitPolicy GetPolicyViaSyntax(int numberOfExecutions, TimeSpan perTimeSpan)
{
return Policy.RateLimitAsync<ResultClassWithRetryAfter>(numberOfExecutions, perTimeSpan);
return Policy.RateLimitAsync(numberOfExecutions, perTimeSpan);
}

protected override IRateLimitPolicy GetPolicyViaSyntax(int numberOfExecutions, TimeSpan perTimeSpan, int maxBurst)
{
return Policy.RateLimitAsync<ResultClassWithRetryAfter>(numberOfExecutions, perTimeSpan, maxBurst);
return Policy.RateLimitAsync(numberOfExecutions, perTimeSpan, maxBurst);
}

protected override (bool, TimeSpan) TryExecuteThroughPolicy(IRateLimitPolicy policy)
{
if (policy is AsyncRateLimitPolicy<ResultClassWithRetryAfter> typedPolicy)
if (policy is AsyncRateLimitPolicy typedPolicy)
{
try
{
Expand Down
6 changes: 3 additions & 3 deletions src/Polly.Specs/RateLimit/RateLimitPolicySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public void Dispose()

protected override IRateLimitPolicy GetPolicyViaSyntax(int numberOfExecutions, TimeSpan perTimeSpan)
{
return Policy.RateLimit<ResultClassWithRetryAfter>(numberOfExecutions, perTimeSpan);
return Policy.RateLimit(numberOfExecutions, perTimeSpan);
}

protected override IRateLimitPolicy GetPolicyViaSyntax(int numberOfExecutions, TimeSpan perTimeSpan, int maxBurst)
{
return Policy.RateLimit<ResultClassWithRetryAfter>(numberOfExecutions, perTimeSpan, maxBurst);
return Policy.RateLimit(numberOfExecutions, perTimeSpan, maxBurst);
}

protected override (bool, TimeSpan) TryExecuteThroughPolicy(IRateLimitPolicy policy)
{
if (policy is RateLimitPolicy<ResultClassWithRetryAfter> typedPolicy)
if (policy is RateLimitPolicy typedPolicy)
{
try
{
Expand Down
1 change: 0 additions & 1 deletion src/Polly.Specs/RateLimit/RateLimitPolicyTResultSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using Polly.RateLimit;
using Polly.Specs.Helpers;
using Polly.Specs.Helpers.RateLimit;
Expand Down

0 comments on commit c916be5

Please sign in to comment.