Today, we’re shipping two new releases:
2.0.1
1.21.0
(release notes)It’s been 5 weeks since the release of 2.0.0
RTM.
As always, we’d like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code contributions. 🎉
These release notes are a list of changes from 2.0.0
to 2.0.1
.
We will no longer emit UTF-8 byte-order marks into reports. This should make the files more compatible with automated tooling (like the GitHub Actions action github-test-reporter
). xunit/xunit#3224
We have improved performance for NCrunch users by bypassing expensive JSON serialization and deserialization steps in message reporting, which was exacerbated by the use of synchronous message reporting. xunit/xunit#3228
We have resolved two inconsistencies when calling IXunitSerializer
. First, when using arrays, calling SerializationHelper.Serialize
would pass the instance of the array to IXunitSerializer.IsSerializable
, but SerializationHelper.IsSerializable
would not. Second, we called IXunitSerializer.IsSerializable
twice for each element in the array when once was sufficient. xunit/xunit#3243
BUG: When generating the entry point for v3 test projects, we failed to normalize the namespace to ensure it was legal. For example, if your project name used characters that weren’t legal in a namespace (like a dash: -
) and did not set <DefaultNamespace>
in your project file to something legal, we would generate namespaces using the project name, which weren’t legal. We now follow the same logic that Microsoft Testing Platform uses for namespace normalization, since we need our generated namespace to match theirs. xunit/xunit#3241
BUG: When running in Microsoft Testing Platform mode, any cleanup failure messages were being silently ignored, which caused test projects to pass inappropriately. Now they are reported onto every affected test node (i.e., a test class cleanup failure will be reported as a additional failure of every test in the test class, regardless of what the original state of the test was). xunit/xunit#3213
BUG: We have added support for converting Trace.Assert
and Debug.Assert
failures into test failures. In some scenarios this used to hard-crash the test process. xunit/xunit#3220
BUG: We fixed an issue where the randomizer provided by Randomizer.Current
was not thread safe. If accessed from multiple threads simultaneously, it could end up returning strings of 0
instead of random numbers. xunit/xunit#3212
BUG: We fixed an issue with TheoryData
where a compiler ambiguity error was thrown if it could not determine whether the data being added was raw data or theory data row data (typically for null
values). Note: This utilizes OverloadResolutionPriorityAttribute
which is only recognized by C# 13 (and later) which ships with .NET SDK 9. If you have this compiler ambiguity, either upgrade to the latest .NET SDK or add casts to the data to resolve the ambiguity. xunit/xunit#3197
We have add a new assertion: Assert.MultipleAsync
works the same way as Assert.Multiple
, except that the lambdas passed to the assertion are Task
-returning (async). xunit/xunit#3209
BUG: Fixed an issue with Assert.Equivalent
when comparing objects that had replaced properties with the new
keyboard. xunit/xunit#3193
MessageMetadataCache
to acquire metadata information for the cleanup messages, which surfaced in normal use with the first party runnings saying <unknown XYZ>
when printing “XYZ” cleanup failure information (i.e., <unknown test class>
for ITestClassCleanupFailure
). xunit/xunit#3221xunit.v3.assert
package should no longer include dependencies on System.Collections.Immutable
or System.Memory
for users targeting .NET 8+, as the versions included in the framework itself are sufficient.