Skip to content

Commit

Permalink
fix: upgrade xunit to 2.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
egil committed Oct 14, 2023
1 parent 311e2c8 commit 5a6f8b5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
10 changes: 0 additions & 10 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@
<PackageReference Include="Xunit.Combinatorial" Version="1.6.24" />
</ItemGroup>

<ItemGroup>
<!-- DO NOT UPGRADE TO versions > 2.4.2 as they do not support .net5 or older -->
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>

<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.testassets' AND $(MSBuildProjectName) != 'AngleSharpWrappers.Tests'">
<Using Include="AutoFixture" />
<Using Include="AutoFixture.Xunit2" />
Expand Down
4 changes: 2 additions & 2 deletions tests/bunit.core.tests/Rendering/TestRendererTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public async Task Test202()
}

[Fact(DisplayName = "UnhandledException has a reference to latest unhandled exception thrown by a component during OnAfterRenderAsync")]
public void Test203()
public async Task Test203()
{
// Arrange
var planned = JSInterop.SetupVoid("foo");
Expand All @@ -421,7 +421,7 @@ public void Test203()

// Assert
planned.VerifyInvoke("foo");
Renderer.UnhandledException.Result.ShouldBeOfType<InvalidOperationException>();
(await Renderer.UnhandledException).ShouldBeOfType<InvalidOperationException>();
}

[Fact(DisplayName = "Multiple calls to StateHasChanged from OnParametersSet with SetParametersAndRender")]
Expand Down
10 changes: 10 additions & 0 deletions tests/bunit.core.tests/bunit.core.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.5.2" />
<!-- DO NOT UPGRADE TO versions > 2.4.5 as they do not support .net5 or older -->
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions tests/bunit.testassets/bunit.testassets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<ItemGroup>
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.5.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.assert" Version="2.5.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Bunit.TestDoubles;
namespace Bunit.TestDoubles;

public class FakeSignOutSessionStateManagerTest : TestContext
{
Expand All @@ -16,12 +16,12 @@ public void ShouldSignOut(string randomUserName)
}

[Fact]
public void ShouldReturnSignOutStateOnValidateSignOutState()
public async Task ShouldReturnSignOutStateOnValidateSignOutState()
{
var cut = new FakeSignOutSessionStateManager(Substitute.For<IJSRuntime>());
cut.SetSignOutState();
await cut.SetSignOutState();

var wasValidate = cut.ValidateSignOutState().Result;
var wasValidate = await cut.ValidateSignOutState();

wasValidate.ShouldBeTrue();
cut.IsSignedOut.ShouldBeFalse();
Expand Down
10 changes: 10 additions & 0 deletions tests/bunit.web.tests/bunit.web.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.5.2" />
<!-- DO NOT UPGRADE TO versions > 2.4.5 as they do not support .net5 or older -->
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit 5a6f8b5

Please sign in to comment.