Release Notes: February 11, 2018
xUnit.net v2 2.4 Beta 1
Core framework
-
A new feature called "test method display options" is available. This features some built-in transformations
of test names automatically, in an attempt to generate more readable test names. This comprises a set of flags
that can be enabled for individual transformations. For more information, see the
methodDisplayOptions
section of Configuration Files.
-
Support for reporting tests to VSTS has been added. Like our support for TeamCity and AppVeyor, this is a reporter
that is automatically enabled when tests are running inside of VSTS. Documentation on how to enable this (with
a sample YAML build definition) will be forthcoming shortly.
-
Data theories can now pass
DateTime
, DateTimeOffset
, and Guid
values
as strings, and they will be converted automatically to the matching argument type. This is most useful
with [InlineData]
, which does not allow any of these types natively.
-
BUG: Fixed an issue where implicit and explicit conversion operator methods were not always
used when converting theory data.
-
BUG: JSON configuration for
maxParallelThreads
did not properly support the special
values of 0
and -1
.
-
BUG: Fixed an issue with some incorrectly escaped characters when reporting to TeamCity
(which caused some test names to get mangled or truncated).
Assertion library
-
BUG: Fixed an issue when
Assert.All
encountered a null
data element.
Console runner
-
Swapped
-noappdomain
for -appdomains [required|ifavailable|denied]
, to
better align with the values from configuration files. The old switch is still supported, but no
longer listed in the help page. The default value is ifavailable
.
-
Updated
-help
to show that -method
can take wildcards.
-
BUG: Fixed an issue where invoking the console runner without arguments could throw
an exception rather than showing the help page.
dotnet xunit runner
-
When targeting
netcoreapp2.0
or later, you can now generate the full set of output
reports: HTML, XML v1, XML v2, and NUnit 2.5. (When targeting netcoreapp1.0
, you are
still limited to just XML v2 reports.)
-
Swapped
-noappdomain
for -appdomains [required|ifavailable|denied]
, to
better align with the values from configuration files. The old switch is still supported, but no
longer listed in the help page. The default value is ifavailable
.
-
Updated
-help
to show that -method
can take wildcards.
- Optimized (and cached) assembly resolution for .NET Core projects.
-
BUG: Fixed issues related to running on operating systems that were currently
unknown to .NET Core (for example, macOS 10.13). This usually surfaced as an inability to load
platform-specific assemblies when running on these platforms.
-
BUG: Fixed issues related to libraries not loading from the dependency list. This surfaced
most commonly as failures with MVC TestHost.
-
BUG: Fixed an issue related to .NET SDK 2.0.3 which was causing failures to find the
2.0
runtime (when the 2.0.0
runtime was the one desired).
-
BUG: Fixed an issue with using relative paths instead of absolute paths when setting
the working directory for executing tests.
MSBuild runner
-
Updated the
AppDomains='value'
attribute to accept all the legal values (required
,
ifavailable
, and denied
), to better align with the values from configuration files.
This was previously a boolean value, so the old values are still supported (true
maps to
required
, and false
maps to denied
). The default value is
ifavailable
.
-
BUG: The
FailSkips
attribute was previously not settable. This
has been fixed.
VSTest plugin (for dotnet test and Visual Studio Test Explorer)
-
The RunSettings file can now include a reporter (i.e.,
quiet
, teamcity
, etc.)
The element is at /RunSettings/RunConfiguration/ReporterSwitch
, with the reporter switch
name being the inner text of the element (i.e.,
<ReporterSwitch>quiet</ReporterSwitch>
).
-
Experimental support for Test Platform v2 with UWP has been added, for future Visual Studio releases.
-
BUG: In some cases, having a trait with an empty value caused test discovery and/or
execution failure.
-
BUG: Fixed an issue with test method names that contained colons. This was most commonly
seen with F# tests.
-
BUG: Fixed an issue where passing incompatible test method data to params arrays on
data theories caused test discovery to fail (and would show as forever discovering in the Test Explorer UI).
Extensibility
-
The reflection abstraction for CLR attributes now allows field setters (in addition to property setters)
when reflecting on attribute constructor arguments. While there were no attributes in xUnit.net itself
that used field setters, this will allow extensibility authors to write custom extension attributes that
use fields rather than properties for optional attribute arguments.