This is co-released with
xunit.runner.visualstudio
version 2.5.1-pre.15
.
There have been no changes to the analyzers, so this version continues to reference
xunit.analyzers
version 1.3.0-pre.19
.
SerializationHelper
public. This class can be used to perform the serialization
that we normally use in xunit.runner.visualstudio
. This code is shared on both sides of the
system, so it's available as Xunit.SerializationHelper
in xunit.runner.utility.*
for runner authors, and Xunit.Sdk.SerializationHelper
in xunit.execution.*
for
extensibility authors. Note that the code is slightly different in that the execution version supports
assemblies marked with PlatformSpecificAssemblyAttribute
to transform their assembly
names in types to include the {Platform}
tag as appropriate. (This is behavior that only
applies to the execution side, and only for v2 tests.) This class can serialize any type that is supported
by xUnit.net's built-in serialization, which includes:
char
string
byte
and sbyte
short
and ushort
int
and uint
long
and ulong
float
and double
decimal
bool
DateTime
, DateTimeOffset
, and TimeSpan
BigInteger
(.NET Core only)Type
IXunitSerializable
Assert.RaisesAny
and Assert.RaisesAnyAsync
to support
event handlers which return raw EventArgs
. This overload is non-generic (the generic overloads
are still used to obtain specific event data types). The need for this overload comes from the fact
that the delegate types for EventHandler
and EventHandler<T>
are not
compatible, so a non-generic version was required. These are the Any
variants because they
support events which return EventArgs
or any type that is derived from it; if you want
strong typing, you should follow up the Assert.RaisesAny
or Assert.RaisesAnyAsync
with an assertion like Assert.IsType
for the specific type you want to verify.
xunit/xunit#2773
xunit.assert.source
NuGet package to include a .editorconfig
file
that marks all files in the package as "auto-generated" so that they will be skipped for source analysis.
Previously, they would end up running against the analyzer rules for the importing project, and frequently
run afoul of things like not matching the desired coding style and formatting rules.
Assert.Equivalent
when comparing two values
which derive from FileSystemInfo
but weren't the same concrete type. This comparison now
just outright fails for mismatched types.
AssertHelper
when imported via xunit.assert.source
with .NET Standard 1.2 - 1.6 (complaining about the unavailability of the AppDomain
type).