Skip to content
Closed
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
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageVersion Include="Cake.FileHelpers" Version="7.0.0" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
<PackageVersion Include="Flurl.Http.Signed" Version="4.0.2" />
<PackageVersion Include="FsCheck.Xunit" Version="3.3.2" />
<PackageVersion Include="FsCheck.Xunit.v3" Version="3.3.2" />
<PackageVersion Include="FSharp.Core" Version="8.0.200" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.1" />
<PackageVersion Include="IcedTasks" Version="0.11.4" />
Expand Down Expand Up @@ -38,8 +38,9 @@
<PackageVersion Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3.assert" Version="3.2.1" />
<PackageVersion Include="xunit.v3.mtp-off" Version="3.2.1" />
</ItemGroup>
<!-- Dependencies below are pinned for the libraries we ship to NuGet.org -->
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<PackageReference Include="NSubstitute" />
<PackageReference Include="ReportGenerator" PrivateAssets="all" />
<PackageReference Include="Shouldly" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit.v3.mtp-off" />
</ItemGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETFramework'">
Expand Down
2 changes: 1 addition & 1 deletion src/Snippets/Snippets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="NSubstitute" />
<PackageReference Include="Refit.HttpClientFactory" />
<PackageReference Include="RestSharp" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3.assert" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Polly.Hedging.Utils;
using Polly.Telemetry;
using Polly.Testing;
using Xunit.Abstractions;

namespace Polly.Core.Tests.Hedging;

Expand Down
3 changes: 2 additions & 1 deletion test/Polly.Core.Tests/Polly.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<Threshold>100</Threshold>
<NoWarn>$(NoWarn);S6966</NoWarn>
<OutputType>Exe</OutputType>
<Include>[Polly.Core]*</Include>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
Expand All @@ -15,7 +16,7 @@
<Compile Include="..\Shared\TestCancellation.cs" Link="TestCancellation.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FsCheck.Xunit" />
<PackageReference Include="FsCheck.Xunit.v3" />
<PackageReference Include="Microsoft.Bcl.TimeProvider" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" />
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Core.Tests/ResiliencePipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class ResiliencePipelineTests
#pragma warning disable IDE0028
public static TheoryData<ResilienceContextPool?> ResilienceContextPools = new()
{
null,
null as ResilienceContextPool,
ResilienceContextPool.Shared,
};
#pragma warning restore IDE0028
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ public class PipelineComponentFactoryTests
#pragma warning disable IDE0028
public static TheoryData<IEnumerable<Action>> EmptyCallbacks = new()
{
Array.Empty<Action>(),
Array.Empty<Action>() as IEnumerable<Action>,
Enumerable.Empty<Action>(),
new List<Action>(),
new EmptyActionEnumerable(), // Explicitly does not provide TryGetNonEnumeratedCount()
new List<Action>() as IEnumerable<Action>,
new EmptyActionEnumerable() as IEnumerable<Action>, // Explicitly does not provide TryGetNonEnumeratedCount()
};

public static TheoryData<IEnumerable<Action>> NonEmptyCallbacks = new()
{
new[] { () => { } },
new[] { () => { } } as IEnumerable<Action>,
Enumerable.TakeWhile(Enumerable.Repeat(() => { }, 50), (_, i) => i < 1), // Defeat optimisation for TryGetNonEnumeratedCount()
new List<Action> { () => { } },
new List<Action> { () => { } } as IEnumerable<Action>,
};
#pragma warning restore IDE0028

Expand Down
1 change: 1 addition & 0 deletions test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
<Threshold>100</Threshold>
<OutputType>Exe</OutputType>
<Include>[Polly.Extensions]*</Include>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
<Threshold>100</Threshold>
<OutputType>Exe</OutputType>
<Include>[Polly.RateLimiting]*</Include>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions test/Polly.Specs/Helpers/Bulkhead/AnnotatedOutputHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public Item(string format, object[] args)

private readonly ITestOutputHelper _innerOutputHelper;

public string Output => _innerOutputHelper.Output;

public AnnotatedOutputHelper(ITestOutputHelper innerOutputHelper) =>
_innerOutputHelper = innerOutputHelper ?? throw new ArgumentNullException(nameof(innerOutputHelper));

Expand Down
12 changes: 12 additions & 0 deletions test/Polly.Specs/Helpers/Bulkhead/SilentOutputHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

public class SilentOutputHelper : ITestOutputHelper
{
public string Output => string.Empty;

public void Write(string message)
{
// Do nothing: intentionally silent.
}

public void Write(string format, params object[] args)
{
// Do nothing: intentionally silent.
}

public void WriteLine(string message)
{
// Do nothing: intentionally silent.
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Specs/Polly.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<ProjectType>Test</ProjectType>
<Threshold>94,94,91</Threshold>
<Include>[Polly]*</Include>
Expand All @@ -22,7 +23,6 @@
<Using Include="Polly.Specs.Helpers.Custom.PreExecute" />
<Using Include="Polly.Specs.Helpers.RateLimit" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
<Using Include="Xunit.Sdk" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions test/Polly.Testing.Tests/Polly.Testing.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
<Threshold>100</Threshold>
<OutputType>Exe</OutputType>
<Include>[Polly.Testing]*</Include>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion test/Shared/TestCancellation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Xunit;

namespace Polly;

internal static class TestCancellation
{
public static CancellationToken Token => CancellationToken.None;
public static CancellationToken Token => TestContext.Current.CancellationToken;
}
Loading