コード例 #1
0
  private void assertThrowOnVoidMethod(TestInterface testObject) {
    Recorder<TestInterface> recorder = TestObject.createRecorder(testObject);

    testObject.returnNothing();
    recorder.recordForLastCall().andThrow(new RuntimeException());

    testObject.returnNothing();
  }
コード例 #2
0
 private void assertDefaultPrimitiveTypeReturnValues(TestInterface testObject) {
   testObject.returnNothing();
   assertEquals(false, testObject.returnBoolean());
   assertEquals(0, testObject.returnChar());
   assertEquals(0, testObject.returnByte());
   assertEquals(0, testObject.returnShort());
   assertEquals(0, testObject.returnInt());
   assertEquals(0, testObject.returnLong());
   assertTrue(0 == testObject.returnDouble());
   assertTrue(0 == testObject.returnFloat());
 }