Core Framework v2 2.7.1 2024 April 11
Today, we're shipping three new releases:
- xUnit.net Core Framework v2
2.7.1 - xUnit.net Analyzers 1.12.0 (release notes)
- xUnit.net Visual Studio adapter 2.5.8 (release notes)
It's been 2 months since the release of 2.7.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 2.7.0 to 2.7.1.
Core Framework
We have added support for .NET diagnostic events to be reported for the start and finish of individual tests. The event source name is
xUnit.TestEventSource, and the provider GUID isae399e80-45fc-4219-aacc-b73a458ad7e1. Please note that if you are trying to use Concurrency Visualizer that sometimes the start & stop events will not be correctly correlated for async tests, as they may begin and end on different threads. This is unfortunately a limitation of Concurrency Visualizer, though the events should always be present (but not correlated, so marked as diamonds). Please see the linked issue for extensive discussion on this. xunit/xunit#2884BUG: We fixed an issue with the timeout async guard (that is, the code that ensures that you must write an async test to use
Timeouton[Fact]or[Theory]) which was inappropriately triggering for F# projects using thetaskkeyword to define the async body of the test. xunit/xunit#2892BUG: We fixed an edge case
SystemAccessViolationthat could occur as we were inspecting thrown exceptions, and their properties (likeStackTraceorMessage) were in turn throwing. While this violates the contract of theExceptionclass, the edge case was seemingly caused by something that was corrupting the exception. Catching and ignoring these exceptions will at least all affected projects to continue to run, albeit with missing information in the exceptions. xunit/xunit#2503
Runner Utility
- BUG: We fixed an unintentional binary backward compatibility breaking bug with
ConfigReaderwhere we added an optional parameter to theLoadfunctions. The old signature has been restored but marked as obsolete and hidden from Intellisense. xunit/xunit#2896
Assertion Library
We have updated
Assert.Equaloverloads forMemory<char>,ReadOnlyMemory<char>,Span<char>, andReadOnlySpan<char>to more clearly indicate that the values are treated as strings and not individual characters. This is primarily a documentation issue in the API documentation (via XML doc comments), as they have always been treated this way.We have added an additional overload for
Assert.Raiseswhich acceptsActionfor attach and detach arguments, in addition to the existingAction<EventHandler>andAction<EventHandler<T>>signatures. xunit/xunit#2888We have added additional overloads for
Assert.Raises,Assert.RaisesAny,Assert.RaisesAnyAsync, andAssert.RaisesAsyncwhich acceptsAction<Action>andAction<Action<T>>for attach and detach arguments, to support event handlers which are defined asActionorAction<T>rather thanEventHandlerorEventHandler<T>. xunit/xunit#2900BUG: We fixed an issue for users of the
xunit.assert.sourceNuGet package that caused compilation errors when also referencingxunit.corefrom duplicate code. xunit/xunit#2889BUG: We fixed an issue with
Assert.Equivalentnot correctly comparingdecimalvalues. It was always reporting two decimals values as equivalent regardless of their actual value. xunit/xunit#2913