From 0083e25092cac0b7bf429674b358b01e6a3b345a Mon Sep 17 00:00:00 2001 From: martincostello Date: Sun, 29 Oct 2023 09:16:59 +0000 Subject: [PATCH] Restore 100% mutations Resolves #1736. --- src/Polly.Core/Polly.Core.csproj | 2 +- .../ResiliencePipelineTests.cs | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Polly.Core/Polly.Core.csproj b/src/Polly.Core/Polly.Core.csproj index c2d35333fa3..e127f6701c6 100644 --- a/src/Polly.Core/Polly.Core.csproj +++ b/src/Polly.Core/Polly.Core.csproj @@ -7,7 +7,7 @@ enable true Library - 99 + 100 true true diff --git a/test/Polly.Core.Tests/ResiliencePipelineTests.cs b/test/Polly.Core.Tests/ResiliencePipelineTests.cs index 9ebad7ae218..95d4cc939fe 100644 --- a/test/Polly.Core.Tests/ResiliencePipelineTests.cs +++ b/test/Polly.Core.Tests/ResiliencePipelineTests.cs @@ -10,12 +10,6 @@ public partial class ResiliencePipelineTests { public static readonly CancellationToken CancellationToken = new CancellationTokenSource().Token; - public static TheoryData ResilienceContextPools = new() - { - null, - ResilienceContextPool.Shared, - }; - [Fact] public async Task DisposeAsync_NullPipeline_OK() { @@ -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(); + 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(); var disposeBehavior = DisposeBehavior.Ignore; + var pool = Substitute.For(); var pipeline = new ResiliencePipeline(component, disposeBehavior, pool); - pipeline.Pool.Should().NotBeNull(); + pipeline.Pool.Should().Be(pool); } public class ExecuteParameters : ExecuteParameters