Today, we’re shipping two new prereleases:
0.5.0-pre.27
3.0.0-pre.42
(release notes)It’s been 4 weeks since the release of 0.4.0-pre.20
.
As always, we’d like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code contributions. 🎉
We have created two new pieces of documentation that we will continue to evolve as we create newer prerelease versions of xUnit.net v3:
We recommend you read them in that order. The migration guide will help you understand what changes are necessary to get your v2 test project ready to upgrade to v3, and it includes a fairly comprehensive list of the changes (and hopefully relatively small bumps in the road) that you can expect. This latter part is provided primarily in resource form, so rather than reading the giant boring lists, you can do a search on the page when you encounter issues with specific types. Once you’ve got your project ported over to v3, the what’s new guide will be useful to understand what new features are available to you with v3.
Please note that you will need to use a version 3.x.y
release of the Visual Studio adapter to run v3 tests, as the 2.x.y
releases are only capable of running v1 and v2 tests. We will eventually stop shipping the 2.x.y
builds, as the 3.x.y
builds are also capable of running v1 and v2 tests. We’d love if users test the 3.x.y
release of the Visual Studio adapter even if they cannot migrate to the v3 Core Framework.
These release notes are a list of changes from 0.4.0-pre.20
to 0.5.0-pre.27
.
We have added a new way to support serializing theory data types without requiring you implement IXunitSerializable
on the type. For more information, see the documentation. xunit/xunit#3040
We have enabled support for custom runner reporters in v3. For more information, see the documentation. xunit/xunit#1874
We have marked the [InlineData]
params array as nullable, so that you can write [InlineData(null)]
to represent passing a single null value to your test. Previously you would have had to call it with [InlineData(null!)]
if you were compiling with nullable reference types enabled. xunit/xunit#3037
We have added built-in serializer support for System.Guid
and System.Uri
. xunit/xunit#3038
BUG: We have fixed an issue where AsyncLocal<T>
was no longer working when set from a test class constructor and then accessed the test method. xunit/xunit#3033
BUG: We have fixed a race condition that occurred during shutdown when “long running test detection” was enabled that could cause the test process to crash.
BUG: We have fixed an issue where source information (file & line number) for a unit test was not reported when the test is inherited from a class in another project. xunit/xunit#3023
System.Uri
to Assert.Equivalent
.The built-in runner and the multi-assembly console runner (xunit.v3.runner.console) now support a switch to enable long-running test detection. The switch is -longRunning <seconds>
for the native xUnit.net command lines, and --long-running <seconds>
for the Microsoft Testing Platform command line. This automatically enables diagnostic messages, which is how long-running test detection messages are reported.
We have added a new diagnostic message that should improve the situation when users have disabled the app host (which is not supported) for v3 test projects, when trying to run them from multi-assembly runners (including our console runner, our MSBuild runner, and our Visual Studio VSTest adapter). xunit/visualstudio.xunit#419
IJsonSerializable.ToJson
to allow it to return null
to indicate “this value isn’t serializable” rather than forcing it to throw an exception.Functional:
In-box Console and MSBuild runners
Command line (dotnet test
anddotnet vstest
) [tested with17.11.9
]
Visual Studio 2022 (Test Explorer) [tested with17.11.9
]
Visual Studio Code [tested with1.94.2
]
Support for dotnet test
, Visual Studio, and Visual Studio Code comes from the Visual Studio runner (a 3.x.y
build of xunit.runner.visualstudio
).
Functional:
NCrunch [requires
5.10
or later]
Resharper/Rider [requires2024.2
or later]
Status unknown:
CodeRush