-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add built-in support to exit an Assert.Multiple() block early #4461
Comments
One more thing to consider, it the |
True. If we use a method-based approach, I wonder if we'd want to allow that to be configurable.
To me the name |
I find the idea of something like this intriguing too: public class MultipleAssertContext {
public MultipleAssertContext? ParentContext { get; }
public int FailureCount { get; }
public int TotalFailureCount { get; }
public void Exit();
} and then: Assert.Multiple((context) => {
// Lots of complicated assertions
if (arbitraryCondition)
{
context.Exit();
}
Assert.Fail("This doesn't run");
}); |
I don't think we should add a parameter, potentially we can add something to There is currently no hierarchy of I don't see many test themselves care about |
I could see |
I think the introduction of the @manfred-brands Reaching out as you're the other to have been involved in discussion here. I'm inclined to close this, but feel free to reopen if you feel otherwise |
@stevenaw I agree on closing this. If early exit is wanted, why are they combined in a single |
As discussed in #4451
It may be helpful to have a built-in way to exit an
Assert.Multiple()
block early. Currently the only ways are:Assert.Multiple()
in a single commandSome ideas discussed in #4451 are:
Assert.MultipleExit()
orAssert.FailFast()
MultipleAssertionContext
passed into the lambda by the framework as an argument for the lambdaThe text was updated successfully, but these errors were encountered: