Skip to content

Commit

Permalink
Fix S3717 (#1965)
Browse files Browse the repository at this point in the history
  • Loading branch information
gintsk authored Feb 10, 2024
1 parent 2ad40a8 commit c8c1890
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/Polly.Specs/Polly.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Include>[Polly]*</Include>
<IncludePollyUsings>true</IncludePollyUsings>
<NoWarn>$(NoWarn);S103;S104;IDE0011;SA1600;SA1204;CA2008;CA2201;</NoWarn>
<NoWarn>$(NoWarn);S3878;CA1030;S3717;S1402;SA1649;SA1402;CA1031</NoWarn>
<NoWarn>$(NoWarn);S3878;CA1030;S1402;SA1649;SA1402;CA1031</NoWarn>
<NoWarn>$(NoWarn);S2184;</NoWarn>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions test/Polly.Specs/Timeout/TimeoutAsyncSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public async Task Should_rethrow_exception_from_inside_delegate__pessimistic()
{
var policy = Policy.TimeoutAsync(TimeSpan.FromSeconds(10), TimeoutStrategy.Pessimistic);

await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotImplementedException())).Should().ThrowAsync<NotImplementedException>();
await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotSupportedException())).Should().ThrowAsync<NotSupportedException>();
}

[Fact]
Expand Down Expand Up @@ -340,7 +340,7 @@ public async Task Should_rethrow_exception_from_inside_delegate__optimistic()
{
var policy = Policy.TimeoutAsync(TimeSpan.FromSeconds(10), TimeoutStrategy.Optimistic);

await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotImplementedException())).Should().ThrowAsync<NotImplementedException>();
await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotSupportedException())).Should().ThrowAsync<NotSupportedException>();
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions test/Polly.Specs/Timeout/TimeoutSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void Should_rethrow_exception_from_inside_delegate__pessimistic()
{
var policy = Policy.Timeout(TimeSpan.FromSeconds(10), TimeoutStrategy.Pessimistic);

policy.Invoking(p => p.Execute(() => throw new NotImplementedException())).Should().Throw<NotImplementedException>();
policy.Invoking(p => p.Execute(() => throw new NotSupportedException())).Should().Throw<NotSupportedException>();
}

[Fact]
Expand Down Expand Up @@ -401,7 +401,7 @@ public void Should_rethrow_exception_from_inside_delegate__optimistic()
{
var policy = Policy.Timeout(TimeSpan.FromSeconds(10), TimeoutStrategy.Optimistic);

policy.Invoking(p => p.Execute(() => throw new NotImplementedException())).Should().Throw<NotImplementedException>();
policy.Invoking(p => p.Execute(() => throw new NotSupportedException())).Should().Throw<NotSupportedException>();

}

Expand Down
4 changes: 2 additions & 2 deletions test/Polly.Specs/Timeout/TimeoutTResultAsyncSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public async Task Should_rethrow_exception_from_inside_delegate__pessimistic()
{
var policy = Policy.TimeoutAsync<ResultPrimitive>(TimeSpan.FromSeconds(10), TimeoutStrategy.Pessimistic);

await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotImplementedException())).Should().ThrowAsync<NotImplementedException>();
await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotSupportedException())).Should().ThrowAsync<NotSupportedException>();
}

#endregion
Expand Down Expand Up @@ -304,7 +304,7 @@ public async Task Should_rethrow_exception_from_inside_delegate__optimistic()
{
var policy = Policy.TimeoutAsync<ResultPrimitive>(TimeSpan.FromSeconds(10), TimeoutStrategy.Optimistic);

await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotImplementedException())).Should().ThrowAsync<NotImplementedException>();
await policy.Awaiting(p => p.ExecuteAsync(() => throw new NotSupportedException())).Should().ThrowAsync<NotSupportedException>();
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions test/Polly.Specs/Timeout/TimeoutTResultSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void Should_rethrow_exception_from_inside_delegate__pessimistic()
{
var policy = Policy.Timeout<ResultPrimitive>(TimeSpan.FromSeconds(10), TimeoutStrategy.Pessimistic);

policy.Invoking(p => p.Execute(() => throw new NotImplementedException())).Should().Throw<NotImplementedException>();
policy.Invoking(p => p.Execute(() => throw new NotSupportedException())).Should().Throw<NotSupportedException>();
}

[Fact]
Expand Down Expand Up @@ -402,7 +402,7 @@ public void Should_rethrow_exception_from_inside_delegate__optimistic()
{
var policy = Policy.Timeout<ResultPrimitive>(TimeSpan.FromSeconds(10), TimeoutStrategy.Optimistic);

policy.Invoking(p => p.Execute(() => throw new NotImplementedException())).Should().Throw<NotImplementedException>();
policy.Invoking(p => p.Execute(() => throw new NotSupportedException())).Should().Throw<NotSupportedException>();
}

#endregion
Expand Down

0 comments on commit c8c1890

Please sign in to comment.