Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S3717 #1965

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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