Today, we're shipping three new releases:
It's been 7 months since the release of 1.1.0 RTM.
This update includes a few new analyzers, lots of updates and bug fixes, and is the first version that officially supports xUnit.net v3 (which is still in alpha). Although we are shipping this with the v2 2.5.0 core framework, as always this remains version independent, and can be used with tests written against any version of the v2 or v3 core framework.
This version takes a dependency on Roslyn 4.0.1, which means that the only officially supported version of Visual Studio is 2022+, as well as any compatible version of the the C# plugin for Visual Studio Code, .NET SDK, and/or Mono.
As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code contributions. 🎉
Note that we have moved away from Twitter for our occasional updates, and now make those available
on our Mastodon account: @xunit@dotnet.social
.
You may follow along by creating a Mastodon account
and following our account, or via a news reader using the RSS feed.
These release notes are a comprehensive list of changes from 1.1.0 to 1.2.0.
ITheoryDataRow
in addition to object[]
to represent a row of data. This new interface allows you to provide additional metadata along
with a data row, including a skip message, a custom test display name, a timeout,
traits, and a flag which indicates whether the data row should only be run when running
explicit tests. The analyzer needed to be updated to not flag on this data type, when
used in v3 tests.
xunit/xunit#2735
_
as well parameters named starting with an
underscore followed by a integer number (e.g., _123
).
xunit/xunit#2730
void
or
Task
, and for v3 tests you can also return ValueTask
. Any other
return value is invalid. In particular, this should help people who may be accidentally
returning ValueTask
instead of Task
for v2 tests, as v2 does
not support ValueTask
.
xunit/xunit#1415
xunit/xunit#2733
[Fact]
) is
legal in a compiler sense, but we do not discover nor support them. This analyzer should trigger
on anything derived from FactAttribute
or DataAttribute
.
xunit/xunit#2277
params
-style array in the
test method. A secondary issue (for non-empty explicit arrays) was also discovered and fixed at the same time.
xunit/xunit#2711
RemoveMethodParameterFix
(shared by
xUnit1022 and
xUnit1026) caused by specifically
malformed code in the text editor.
xunit/xunit#2675
.Count
from
a concrete collection type (f.e., List<int>
) but not from an interface
(f.e., ICollection<int>
).
xunit/xunit#2736
Assert.IsNotAssignableFrom
assertion. This includes an updated
message in the analyzer, and updated code generation for the fixer.
xunit/xunit#2727
Assert.Fail(message)
rather than Assert.True(false, message)
or Assert.False(true, message)
.
For projects targeting older versions of xUnit.net, this analyzer & fixer does not trigger.
xunit/xunit#2521
new string(' ', 4)
to not be a constant expected value in
Assert.Equal
.
xunit/xunit#2394
install.ps1
and uninstall.ps1
files are now the signed
versions provided by Microsoft.
4.0.1
of Microsoft.CodeAnalysis
. In addition
to bringing us up to date with latest language features, this also gives us better coverage when
your tests are being compiled with Nullable
Reference Types enabled. This should allow us to enable future analyzers based on newer C#
language features, and should also help our analyzers be more robust (as the libraries we're
consuming now themselves are enabled for Nullable Reference Types).