Today, we're shipping three new releases:
It's been 2 months since the release of 1.11.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.11.0 to 1.12.0.
TheoryData<>
that are not (1044) or might not (1045) be serializable. The purpose is
to highlight cases where you may not be able to run individual data rows in Test Explorer in Visual
Studio because of the non-serializability of the theory data. These are separate rules so that you can
choose to disable the "might not" rule (which catches a wider net of types) without losing access to
the "does not" rule (which only triggers for types known to never be serializable).
xunit/xunit#2866
TheoryDataRow
in xUnit.net v3 that is not (1046) or might not (1047)
be serializable. The purpose is to highlight cases where you may not be able to run individual data
rows in Test Explorer in Visual Studio because of the non-serializability of the theory data. These
are separate rules so that you can choose to disable the "might not" rule (which catches a wider net of
types) without losing access to the "is not" rule (which only triggers for types known to never be
serializable). Note that we usually have better type information here, since we're using the
actual data in question (which the compiler may know more about) vs. the two rules above, which are
relying on the generic types rather than concrete data.
CA1515
("Consider making public types internal"). This is coming in .NET 9 and can be seen already showing up when
you are using early access builds. Since all test classes in xUnit.net projects are considered "unreferenced",
this analyzer is incorrectly suggesting that the types be made `internal`. We now suppress this for any class
which has at least one test method in it. This includes not only `[Fact]` and `[Theory]` but also any attributes
derived from `FactAttribute` from third party test framework extensions.
xunit/xunit.analyzers#182
CA2007
("Do not directly await a Task"). This is the analyzer that recommends users always add `.ConfigureAwait(false)`
to task code, which is incorrect behavior for xUnit.net tests since this will push the unit test off of the
thread pool which we use to limit concurrency. Note that this only applies to code directly in unit test methods;
code outside of unit tests (including code in private functions or lambdas inside of a test method) will still
raise CA2007 if you have it enabled, as usage there does not break xUnit.net's parallelization limitation
functionality.