Analyzers 1.23.0 2025 July 13
Today, we're shipping three new releases:
- xUnit.net Core Framework v3
3.0.0
(release notes) - xUnit.net Analyzers
1.23.0
- xUnit.net Visual Studio adapter
3.1.2
(release notes)
It's been 5 weeks since the release of 1.22.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.22.0
to 1.23.0
.
General
- BUG: We have removed batch fixer support due to issues where fixed code could be generated incorrectly due to being generated as a batch rather than individually. xunit/xunit#3336
Assertion Analyzers
We have updated xUnit1003 to detect usage of
IDataAttribute
rather than depending solely on detecting classes derived fromDataAttribute
. xunit/xunit#3174We have updated xUnit1007 to properly check for
[ClassData<>]
, which was introduced in Core Framework v3 3.0.0.We have added xUnit1052 to flag cases where developers are incorrectly trying to embed instances of
ITheoryDataRow
instead ofTheoryData<>
. When usingITheoryDataRow
(or any of its derived types, likeTheoryDataRow<>
), your theory data providers should returnIEnumerable<...>
rather thanTheoryData<...>
. xunit/xunit#3113
Extensibility Analyzers
We have created xUnit3003 to flag classes which extend
FactAttribute
(directly or indirectly) which do not provide a constructor that collects and passes along source location information (file name and line number). This is used to provide source information to Microsoft Testing Platform runners, like Test Explorer anddotnet test
, to link tests to their source code.This analyzer is only applicable to projects which are linked against xUnit.net v3 version
3.0.0
or later.