You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when we expect some exception we can just check class of expected Exception. It would be useful if some matcher could match on exception's message (maybe event fields of Exception).
The text was updated successfully, but these errors were encountered:
...how do I use this in the case that the method I'm calling throws and exception. Obviously in this case it has to be wrapped in a try/catch in the test body. Here's an example I've come up with.
it.should("throw an error when you ask for a coffee type that doesn't exist.", expect -> {
expect.exception(NoSuchCoffeeException.class, () -> {
coffeeMaker.makeCoffee("welsh", false, 37);
});
});
...method signature.... public Coffee makeCoffee(String type, boolean milk, int sugars) throws NoSuchCoffeeException {
Currently when we expect some exception we can just check class of expected Exception. It would be useful if some matcher could match on exception's message (maybe event fields of Exception).
The text was updated successfully, but these errors were encountered: