Analyzers 1.10.0 2024 January 15
Today, we're shipping two new releases:
- xUnit.net Core Framework v2
2.6.6
(release notes) - xUnit.net Analyzers
1.10.0
It's been 2 weeks since the release of 1.9.0
.
As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉
Release Notes
These release notes are a comprehensive list of changes from 1.9.0
to 1.10.0
.
Usage Analyzers
We have updated xUnit1030 and xUnit1031 to not report on code usage inside a local function in the unit test. xunit/xunit.analyzers#178
We have created xUnit1043 to flag an error when the developer uses a non-public constructor on a
FactAttribute
-derived class. While this is legal in the compiler, it fails at runtime due to being unsupported by the test framework. xunit/xunit#2120
Assertion Analyzers
We have updated xUnit2013 to stop reporting against
StringValues
. CallingAssert.Empty
with an instance ofStringValues
calls the wrong overload because of an implicit cast fromStringValues
tostring
(and when the collection is empty, it returns anull
string), so using something likeAssert.Equal(0, stringValues.Count);
is the preferred way to check for an emptyStringValues
collection. xunit/xunit#2859We have created xUnit2028 to report warnings when using
Assert.Empty
orAssert.NotEmpty
with eitherStringValues
orArraySegment<T>
. Both collection types have problematic behavior that is explained in the documentation. xunit/xunit#2860