Skip to content

Commit 2eeafe0

Browse files
authored
Merge pull request #1644 from bUnit-dev/release/v1.38
Release of new minor version v1.38
2 parents 61cef65 + 8dc67ac commit 2eeafe0

File tree

16 files changed

+89
-36
lines changed

16 files changed

+89
-36
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ jobs:
191191
dotnet restore ${{ github.workspace }}/TemplateTestXunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
192192
dotnet test ${{ github.workspace }}/TemplateTestXunit
193193
194+
- name: ✔ Verify xUnit.v3 template
195+
run: |
196+
dotnet new bunit --framework xunitv3 --no-restore -o ${{ github.workspace }}/TemplateTestXunitv3
197+
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Build.props
198+
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Packages.props
199+
dotnet restore ${{ github.workspace }}/TemplateTestXunitv3 --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
200+
dotnet test ${{ github.workspace }}/TemplateTestXunitv3
201+
194202
- name: ✔ Verify NUnit template
195203
run: |
196204
dotnet new bunit --framework nunit --no-restore -o ${{ github.workspace }}/TemplateTestNunit

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- Added support for xunit v3 in the bunit.template. By [@linkdotnet](https://github.com/linkdotnet).
12+
913
## [1.37.7] - 2024-12-13
1014

1115
### Added

Directory.Packages.props

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
<PackageVersion Include="Autofac" Version="8.1.0" />
1616
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
1717

18-
<PackageVersion Include="Serilog" Version="4.1.0"/>
18+
<PackageVersion Include="Serilog" Version="4.2.0"/>
1919
<PackageVersion Include="Serilog.Expressions" Version="5.0.0"/>
2020
<PackageVersion Include="AngleSharp.Diffing" Version="1.0.0"/>
21-
<PackageVersion Include="AngleSharp" Version="1.1.2"/>
21+
<PackageVersion Include="AngleSharp" Version="1.2.0"/>
2222
<PackageVersion Include="AngleSharp.Css" Version="1.0.0-beta.144"/>
2323
</ItemGroup>
2424

2525
<ItemGroup Label="Package Versioning">
26-
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.146" />
26+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
2727
</ItemGroup>
2828

2929
<ItemGroup Label="System.Text.Json Vulnerability">
@@ -114,24 +114,24 @@
114114
<PackageVersion Include="AutoFixture.Xunit2" Version="4.18.1"/>
115115
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.0" />
116116
<PackageVersion Include="MSTest.TestFramework" Version="3.6.0" />
117-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
117+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
118118
<PackageVersion Include="Moq" Version="4.20.72" />
119119
<PackageVersion Include="NSubstitute" Version="5.3.0" />
120120
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
121121
<PackageVersion Include="RichardSzalay.MockHttp" Version="7.0.0" />
122-
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
122+
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.0" />
123123
<PackageVersion Include="Shouldly" Version="4.2.1"/>
124124
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0"/>
125-
<PackageVersion Include="Verify.Xunit" Version="28.4.0"/>
125+
<PackageVersion Include="Verify.Xunit" Version="28.8.1"/>
126126
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24"/>
127-
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
128-
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
127+
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
128+
<PackageVersion Include="coverlet.msbuild" Version="6.0.3" />
129129
<PackageVersion Include="nunit" Version="4.2.2" />
130-
<PackageVersion Include="xunit" Version="2.9.2"/>
130+
<PackageVersion Include="xunit" Version="2.9.3"/>
131131
<PackageVersion Include="xunit.abstractions" Version="2.0.3"/>
132-
<PackageVersion Include="xunit.assert" Version="2.9.2"/>
133-
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.2"/>
134-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2"/>
132+
<PackageVersion Include="xunit.assert" Version="2.9.3"/>
133+
<PackageVersion Include="xunit.extensibility.execution" Version="2.9.3"/>
134+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1"/>
135135
</ItemGroup>
136136

137137
<ItemGroup Label="Test Dependencies - Legacy" Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0'">

src/bunit.core/Asserting/ActualExpectedAssertException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using Bunit.Internal.XUnitExceptions;
2+
13
namespace Bunit.Asserting;
24

35
/// <summary>
46
/// Represents a generic assert exception used when an actual result does not match an expected result.
57
/// </summary>
68
[Serializable]
7-
public class ActualExpectedAssertException : Exception
9+
public class ActualExpectedAssertException : Exception, IAssertionException
810
{
911
/// <summary>
1012
/// Initializes a new instance of the <see cref="ActualExpectedAssertException"/> class.

src/bunit.core/Extensions/WaitForHelpers/WaitForFailedException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using Bunit.Internal.XUnitExceptions;
2+
13
namespace Bunit.Extensions.WaitForHelpers;
24

35
/// <summary>
46
/// Represents an exception thrown when the <see cref="WaitForHelper{T}"/> does not complete successfully.
57
/// </summary>
68
[Serializable]
7-
public sealed class WaitForFailedException : Exception
9+
public sealed class WaitForFailedException : Exception, ITestTimeoutException
810
{
911
/// <summary>
1012
/// Initializes a new instance of the <see cref="WaitForFailedException"/> class.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Bunit.Internal.XUnitExceptions;
2+
3+
/// <summary>
4+
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be an assertion failure.
5+
/// </summary>
6+
internal interface IAssertionException;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Bunit.Internal.XUnitExceptions;
2+
3+
/// <summary>
4+
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be a timeout.
5+
/// </summary>
6+
internal interface ITestTimeoutException;

src/bunit.core/ParameterException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Bunit.RazorTesting;
22

33
/// <summary>
4-
/// Represents an missing or invalid Blazor parameter on a Blazor component.
4+
/// Represents a missing or invalid Blazor parameter on a Blazor component.
55
/// </summary>
66
[Serializable]
77
public sealed class ParameterException : ArgumentException

src/bunit.template/template/.template.config/dotnetcli.host.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"usageExamples": [
1717
"--framework xunit --sdk net8.0",
18+
"--framework xunitv3 --sdk net8.0",
1819
"--framework nunit --sdk net8.0",
1920
"--framework mstest --sdk net8.0"
2021
]

src/bunit.template/template/.template.config/template.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"modifiers": [
2525
{
2626
"exclude": [ "BunitTestContext.cs" ],
27-
"condition": "(testFramework_xunit)"
27+
"condition": "(testFramework_xunit || testFramework_xunitv3)"
2828
}
2929
]
3030
}
@@ -58,6 +58,11 @@
5858
"description": "xUnit unit testing framework",
5959
"displayName": "xUnit"
6060
},
61+
{
62+
"choice": "xunitv3",
63+
"description": "xUnit v3 unit testing framework",
64+
"displayName": "xUnit v3"
65+
},
6166
{
6267
"choice": "mstest",
6368
"description": "MSTest unit testing framework",
@@ -73,6 +78,10 @@
7378
"type": "computed",
7479
"value": "UnitTestFramework == \"xunit\""
7580
},
81+
"testFramework_xunitv3": {
82+
"type": "computed",
83+
"value": "UnitTestFramework == \"xunitv3\""
84+
},
7685
"testFramework_mstest": {
7786
"type": "computed",
7887
"value": "UnitTestFramework == \"mstest\""
@@ -85,16 +94,6 @@
8594
"defaultValue": "net9.0",
8695
"replaces": "targetSdk",
8796
"choices": [
88-
{
89-
"choice": "net6.0",
90-
"description": ".net 6.0",
91-
"displayName": ".net 6.0"
92-
},
93-
{
94-
"choice": "net7.0",
95-
"description": ".net 7.0",
96-
"displayName": ".net 7.0"
97-
},
9897
{
9998
"choice": "net8.0",
10099
"description": ".net 8.0",

0 commit comments

Comments
 (0)