Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for xunit.v3 #338

Open
ljb opened this issue Feb 11, 2025 · 1 comment · May be fixed by #339
Open

Support for xunit.v3 #338

ljb opened this issue Feb 11, 2025 · 1 comment · May be fixed by #339

Comments

@ljb
Copy link

ljb commented Feb 11, 2025

Recently, a new major version of xUnit was released. See:
https://xunit.net/docs/getting-started/v3/migration

It would be nice if support was added for this to ArchUnitNET.

I just finished migrating a large code base to use xunit.v3, and ArchUnitNET is the only of my dependencies that doesn't support it.

The new major version of xUnit uses a new NuGet package name: xunit.v3. I have seen that different libraries handle this situation in different ways. Some libraries released a new major version, like FsUnit did with version 7.0.0. Some libraries have opted for creating a new package name. One example of the latter is Verify where they have created a new package name called Verify.XunitV3.

I'm not sure which approach fits ArchUnitNET best.

@ljb
Copy link
Author

ljb commented Feb 11, 2025

I created a pull request for this:
#339

I added a new project called ArchUnitNET.xUnitV3. This follows the same naming convention that is used for ArchUnitNET.MSTestV2. Having a separate project allows having support both for xUnit 2 and xUnit 3.

The new project is basically a copy of the ArchUnitNET.xUnit, but uses xunit.v3.assert for the assertions. I think using copy-and-paste is preferable in this case since the project only consists of three small C# files.

ljb added a commit to ljb/ArchUnitNET that referenced this issue Feb 12, 2025
Add support for xunit.v3

Signed-off-by: Jonas Bengtsson <[email protected]>
@alexanderlinne alexanderlinne linked a pull request Feb 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant