@Test
 public void shouldFailFastWhenArgumentMatchersAbused() {
   misplacedArgumentMatcher();
   try {
     mock(IMethods.class);
     fail();
   } catch (InvalidUseOfMatchersException e) {
     assertContains("Misplaced argument matcher", e.getMessage());
   }
 }
예제 #2
0
 @Test
 public void shouldResetOngoingStubbingSoThatMoreMeaningfulExceptionsAreRaised() {
   mock(IMethods.class);
   mock.booleanReturningMethod();
   reset(mock);
   try {
     when(null).thenReturn("anything");
     fail();
   } catch (MissingMethodInvocationException e) {
   }
 }