diff --git a/test/Polly.Specs/Caching/ResultTtlSpecs.cs b/test/Polly.Specs/Caching/ResultTtlSpecs.cs index ef1a0757e9c..20263362f18 100644 --- a/test/Polly.Specs/Caching/ResultTtlSpecs.cs +++ b/test/Polly.Specs/Caching/ResultTtlSpecs.cs @@ -21,7 +21,7 @@ public void Should_throw_when_func_is_null_using_context() [Fact] public void Should_not_throw_when_func_is_set() { - Action configure = () => _ = new ResultTtl(_ => new Ttl()); + Action configure = () => _ = new ResultTtl(_ => default); configure.Should().NotThrow(); } @@ -29,7 +29,7 @@ public void Should_not_throw_when_func_is_set() [Fact] public void Should_not_throw_when_func_is_set_using_context() { - Action configure = () => _ = new ResultTtl((_, _) => new Ttl()); + Action configure = () => _ = new ResultTtl((_, _) => default); configure.Should().NotThrow(); } diff --git a/test/Polly.Specs/Polly.Specs.csproj b/test/Polly.Specs/Polly.Specs.csproj index e627c0bdb58..9296d061242 100644 --- a/test/Polly.Specs/Polly.Specs.csproj +++ b/test/Polly.Specs/Polly.Specs.csproj @@ -9,7 +9,7 @@ [Polly]* true $(NoWarn);S103;S104;IDE0011;SA1600;SA1204;CA2008;CA2201; - $(NoWarn);S3878;CA1030;S3717;SA1129;S1402;SA1649;SA1402;CA1031 + $(NoWarn);S3878;CA1030;S3717;S1402;SA1649;SA1402;CA1031 $(NoWarn);S2184; diff --git a/test/Polly.Specs/Retry/WaitAndRetryForeverSpecs.cs b/test/Polly.Specs/Retry/WaitAndRetryForeverSpecs.cs index ff961e72e52..dc99f6f3baa 100644 --- a/test/Polly.Specs/Retry/WaitAndRetryForeverSpecs.cs +++ b/test/Polly.Specs/Retry/WaitAndRetryForeverSpecs.cs @@ -66,7 +66,7 @@ public void Should_not_throw_regardless_of_how_many_times_the_specified_exceptio { var policy = Policy .Handle() - .WaitAndRetryForever(_ => new TimeSpan()); + .WaitAndRetryForever(_ => default); policy.Invoking(x => x.RaiseException(3)) .Should().NotThrow(); @@ -78,7 +78,7 @@ public void Should_not_throw_regardless_of_how_many_times_one_of_the_specified_e var policy = Policy .Handle() .Or() - .WaitAndRetryForever(_ => new TimeSpan()); + .WaitAndRetryForever(_ => default); policy.Invoking(x => x.RaiseException(3)) .Should().NotThrow(); diff --git a/test/Polly.Specs/Retry/WaitAndRetrySpecs.cs b/test/Polly.Specs/Retry/WaitAndRetrySpecs.cs index db0c52307a3..71d06c47949 100644 --- a/test/Polly.Specs/Retry/WaitAndRetrySpecs.cs +++ b/test/Polly.Specs/Retry/WaitAndRetrySpecs.cs @@ -551,7 +551,7 @@ public void Should_throw_when_retry_count_is_less_than_zero_without_context() Action policy = () => Policy .Handle() - .WaitAndRetry(-1, _ => new TimeSpan(), onRetry); + .WaitAndRetry(-1, _ => default, onRetry); policy.Should().Throw().And .ParamName.Should().Be("retryCount"); @@ -564,7 +564,7 @@ public void Should_throw_when_retry_count_is_less_than_zero_with_context() Action policy = () => Policy .Handle() - .WaitAndRetry(-1, _ => new TimeSpan(), onRetry); + .WaitAndRetry(-1, _ => default, onRetry); policy.Should().Throw().And .ParamName.Should().Be("retryCount"); @@ -577,7 +577,7 @@ public void Should_throw_when_retry_count_is_less_than_zero_with_attempts_with_c Action policy = () => Policy .Handle() - .WaitAndRetry(-1, _ => new TimeSpan(), onRetry); + .WaitAndRetry(-1, _ => default, onRetry); policy.Should().Throw().And .ParamName.Should().Be("retryCount"); @@ -629,7 +629,7 @@ public void Should_throw_when_onretry_action_is_null_without_context_when_using_ Action policy = () => Policy .Handle() - .WaitAndRetry(1, _ => new TimeSpan(), nullOnRetry); + .WaitAndRetry(1, _ => default, nullOnRetry); policy.Should().Throw().And .ParamName.Should().Be("onRetry"); @@ -642,7 +642,7 @@ public void Should_throw_when_onretry_action_is_null_with_context_when_using_pro Action policy = () => Policy .Handle() - .WaitAndRetry(1, _ => new TimeSpan(), nullOnRetry); + .WaitAndRetry(1, _ => default, nullOnRetry); policy.Should().Throw().And .ParamName.Should().Be("onRetry"); @@ -655,7 +655,7 @@ public void Should_throw_when_onretry_action_is_null_with_attempts_with_context_ Action policy = () => Policy .Handle() - .WaitAndRetry(1, _ => new TimeSpan(), nullOnRetry); + .WaitAndRetry(1, _ => default, nullOnRetry); policy.Should().Throw().And .ParamName.Should().Be("onRetry");