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

xUnit v3 support / enhancements #1631

Open
egil opened this issue Dec 17, 2024 · 5 comments
Open

xUnit v3 support / enhancements #1631

egil opened this issue Dec 17, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@egil
Copy link
Member

egil commented Dec 17, 2024

xUnit v3 is out, and while bUnit should work without issues with it, there are new things we may want to address:

@egil egil added the enhancement New feature or request label Dec 17, 2024
@linkdotnet
Copy link
Collaborator

We also might wanna add xunitv3 or similar for our templates

@linkdotnet
Copy link
Collaborator

Plus we might wanna migrate our testbase sooner or later to v3 (probably something we only wanna do for v2)

@linkdotnet
Copy link
Collaborator

IAssertionException and ITestTimeoutException are new interfaces that we can include in bUnit and mark our assertions exceptions with. See https://xunit.net/docs/getting-started/v3/whats-new#third-party-assertion-library-extension-points

We would need an abstraction and add this behavior as a 3rd party package, not?
Otherwise we are forcing users towards a dependency of xunit.v3?

@egil
Copy link
Member Author

egil commented Dec 17, 2024

IAssertionException and ITestTimeoutException are new interfaces that we can include in bUnit and mark our assertions exceptions with. See https://xunit.net/docs/getting-started/v3/whats-new#third-party-assertion-library-extension-points

We would need an abstraction and add this behavior as a 3rd party package, not?

Otherwise we are forcing users towards a dependency of xunit.v3?

No we simply create the interfaces in our project, probably as internal. XUnit just matches on the name. We don't need a dependency on xUnit packages.

UPDATE:

The interfaces are not included with xunit at all. There are just logic looking for interfaces with those names.

So the assertion exceptions we throw should implement an internal interface IAssertionException {}, and our WaitFor timeout exception should implement internal interface ITestTimeoutException {}, I think.

@linkdotnet
Copy link
Collaborator

We only really have two candidates, in my opinion:
ActualExpectedAssertException and WaitForFailedException.
The latter one is tricky - as it is used in all WaitForXXX operations. Now, We might want to dissect this into two distinct exceptions that represent the nature of asserting and timeout. Because WaitForElement isn't necessarily an assertion.

All other exceptions like ParameterException, ElementRemovedFromDomException and friends are neither a timeout nor an assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants