Today, we’re shipping three new releases:
It’s been 1 month since the release of 1.13.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 comprehensive list of changes from 1.13.0 to 1.14.0.
We fixed an issue where the analyzers were not activating for users using “classic” (pre-SDK style) project files.
We have marked the analyzer NuGet package as a development dependency, which will stop it from propagating to any child projects. xunit/xunit#2930
xUnit.net v3 has introduced a new generic theory data row container named TheoryDataRow<>
. Like TheoryData<>
from v2, we provide versions for up to 10 parameter types. While TheoryData<>
represents a whole collection of data rows, TheoryDataRow<>
represents a single data row. So instead of using IEnumerable<object[]>
(or IAsyncEnumerable<object[]>
), you would use IEnumerable<TheoryDataRow<...>>
(or IAsyncEnumerable<TheoryDataRow<...>>
). In addition to representing a type safe way to provide a single data row, it allows you provide metadata for the data row, including skipping individual data rows, marking a data row as “Explicit”, overriding the display name for the test for the data row, setting an individual timeout for the data row, and providing custom traits for the data row:
public static IEnumerable<TheoryDataRow<int, string>> PropertyData =>
[
new(42, "Hello").WithTrait("Category", "Fast")
new(2600, "World").WithTimeout(1000)
];
Several of the analyzers have been updated for this new type.
We have updated xUnit1007 to properly support the fact that [ClassData]
data sources in xUnit.net v3 can return their data via IAsyncEnumerable<>
in addition to IEnumerable<>
, and to recognize ITheoryDataRow
as a valid alternative to object[]
. The message was updated to reference all the legal types for v3 projects.
We have updated xUnit1019 and xUnit1042 to properly support the fact that [MemberData]
data sources in xUnit.net v3 can return their data wrapped in either Task<>
or ValueTask<>
, as well as the fact that data can be returned as IAsyncEnumerable<>
in addition to IEnumerable<>
.
We have updated xUnit1037, xUnit1038, xUnit1039, and xUnit1040 to support TheoryDataRow<>
in xUnit.net v3, as well as supporting analyzing usages of [ClassData]
when the class implements IEnumerable<TheoryDataRow<>>
or IAsyncEnumerable<TheoryDataRow<>>
.
We have created xUnit1050 for v3 projects to flag instances of [ClassData]
classes which are returning untyped data (object[]
, ITheoryDataRow
, or non-generic TheoryDataRow
) as being candidates for upgrading to the generic version of TheoryDataRow<>
, which provides both compiler benefits and also enables type compatibility analysis rules.