Skip to content

Commit

Permalink
Restore 100% mutations
Browse files Browse the repository at this point in the history
Resolves #1736.
  • Loading branch information
martincostello committed Oct 29, 2023
1 parent 00cd051 commit a847c9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
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

0 comments on commit a847c9f

Please sign in to comment.