From 3ce3b7a08f88f7bce5fd5709f8416fea722ddac2 Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 20 Dec 2024 10:20:41 +0000 Subject: [PATCH] Add migration guide Add a migration guide for moving from xunit v2 to v3. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 9141934..175fcdf 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,23 @@ See below for links to more examples: - [Unit tests][example-unit-tests] - [Integration tests for an ASP.NET Core HTTP application][example-integration-tests] +## Migrating to xunit v3 + +[Xunit v3][xunit-v3-whats-new] contains many major architectural changes which means the same package +that supports logging for xunit v2 cannot be used with xunit v3. The equivalent NuGet package to support +logging for xunit v3 is the new `MartinCostello.Logging.XUnit.v3` package. + +To migrate usage of `MartinCostello.Logging.XUnit` to `MartinCostello.Logging.XUnit.v3` for xunit v3: + +1. Follow the relevant steps to migrate any test projects from [xunit v2 to v3][xunit-v3-migration]. + - The most relevant change in xunit v3 is that the `ITestOutputHelper` type has moved from the `Xunit.Abstractions` namespace to `Xunit`. +1. Change any package references from `MartinCostello.Logging.XUnit` to `MartinCostello.Logging.XUnit.v3`. + + ```diff + - + + + ``` + ## Feedback Any feedback or issues can be added to the issues for this project in [GitHub][issues]. @@ -130,3 +147,5 @@ cd xunit-logging [repo]: https://github.com/martincostello/xunit-loggingE "This project on GitHub.com" [serilog]: https://serilog.net/ "Serilog website" [serilog-sinks-xunit]: https://github.com/trbenning/serilog-sinks-xunit "Serilog.Sinks.XUnit on GitHub" +[xunit-v3-migration]: https://xunit.net/docs/getting-started/v3/migration#migrating-to-v3-packages "Migrating from xunit v2 to v3" +[xunit-v3-whats-new]: https://xunit.net/docs/getting-started/v3/whats-new "What's New in v3"