yuskam / catch-exception

Automatically exported from code.google.com/p/catch-exception
0 stars 0 forks source link

Add additional API that is consistent with the syntax of Mockito #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As suggested by 
http://monkeyisland.pl/2010/07/26/expected-exception-in-tests/#comment-3859 
catch-exception could provide an additional API that is consistent with the 
syntax of Mockito and BDDMockito.

Suggestions:
{{{
when(foo).bar();
thenThrown(RuntimeException.class);

or:

//given
…
//then
thrown(RuntimeException.class).when(foo).bar();

//sort of consistent with Mockito api:
verifyThrown(RuntimeException.class).when(foo).bar();
verifyThrown(messageContains(“foo”)).when(foo).bar();
}}}

Original issue reported on code.google.com by rwoo@gmx.de on 30 Oct 2011 at 7:05

GoogleCodeExporter commented 8 years ago
Solved with Release 1.0.4, see CatchExceptionBdd.

Original comment by rwoo@gmx.de on 10 Feb 2012 at 3:18