コード例 #1
0
  @Test
  public void testAcceptsExceptionsAsValidExpectations() throws Exception {
    StaticInvocation divide = new StaticInvocation(calculator, Calculator.DIVIDE);
    Call call = new Call(divide);
    call.addInput("7", "0");
    call.expect(ShouldBe.instanceOf(ArithmeticException.class));

    call.execute();
    assertTrue(call.wasRight());
  }