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

Restore 100% mutations #1750

Merged
merged 1 commit into from
Oct 29, 2023
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 src/Polly.Core/Polly.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectType>Library</ProjectType>
<MutationScore>99</MutationScore>
<MutationScore>100</MutationScore>
<LegacySupport>true</LegacySupport>
<InjectSharedSources>true</InjectSharedSources>
</PropertyGroup>
Expand Down
25 changes: 15 additions & 10 deletions test/Polly.Core.Tests/ResiliencePipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ public partial class ResiliencePipelineTests
{
public static readonly CancellationToken CancellationToken = new CancellationTokenSource().Token;

public static TheoryData<ResilienceContextPool?> ResilienceContextPools = new()
{
null,
ResilienceContextPool.Shared,
};

[Fact]
public async Task DisposeAsync_NullPipeline_OK()
{
Expand Down Expand Up @@ -78,15 +72,26 @@ public async Task DebuggerProxy_Ok()
new CompositeComponentDebuggerProxy(pipeline).Strategies.Should().HaveCount(2);
}

[Theory]
[MemberData(nameof(ResilienceContextPools))]
public void Pool_NotNull(ResilienceContextPool? pool)
[Fact]
public void Pool_IsSharedPool()
{
var component = Substitute.For<PipelineComponent>();
var disposeBehavior = DisposeBehavior.Ignore;
ResilienceContextPool? pool = null;

var pipeline = new ResiliencePipeline(component, disposeBehavior, pool);
pipeline.Pool.Should().Be(ResilienceContextPool.Shared);
}

[Fact]
public void Pool_IsPool()
{
var component = Substitute.For<PipelineComponent>();
var disposeBehavior = DisposeBehavior.Ignore;
var pool = Substitute.For<ResilienceContextPool>();

var pipeline = new ResiliencePipeline(component, disposeBehavior, pool);
pipeline.Pool.Should().NotBeNull();
pipeline.Pool.Should().Be(pool);
}

public class ExecuteParameters<T> : ExecuteParameters
Expand Down