Release Notes: June 21, 2023
xUnit.net v2 2.5.0 Pre-Release (build 37)
This is co-released with
Assert.Null overloads explicitly for
struct values. Both include new messages, and the
NotNull variant returns the unwrapped
value. This prevents boxing, and makes it trivial to use the non-null value. (We don't need this with the reference
versions, since the type doesn't change, it just sheds its nullability, which we automatically do with
Fixed an issue where using the assertion library as source, combined with
compilation to report
xUnit2015 warnings. These warnings aren't applicable
to the assertion library itself, so they've been suppressed with pragmas. This means you should no longer need to
ignore or disable those warnings when using
xunit.assert.source (or the Git submodule).
BUG: Fixed an issue with the console runner where sometimes, when using newer versions of Windows
Terminal, the output of pointer characters (↓ and ↑) would be garbled as �.
Fixed a performance issue with reporter discovery related to scanning every single DLL in your output folder looking
for types which implement reporters. Now we only scan libraries named
which may break any custom reporters you are using from first or third party assemblies without an appropriate
This release makes
CollectionTracker public (in the assertion library).
The former is used to pretty print values in assertion failures as well arguments for display names of data-driven
tests. The latter is a newly introduced class whose job is to prevent double enumeration while tracking the last few
values visited, so that they can be printed when assertion failures happen without requiring a second enumeration.
We added several pragmas to disable warnings that would occur when
XUNIT_NULLABLE was not defined,
but your project had
<nullable>enable</nullable>. You should always define
xunit.assert.source (or the Git submodule) when you have nullable enabled, but at least now
if you forget to do that, there won't be any compiler warnings as a result of you using our non-nullable path. Note
that we had to use pragmas to disable warnings rather than just using
#nullable disable in the files,
since that pragma didn't exist in C# prior to version 8 (and we set a minimum C# version of 6).