@Test public void testConvertsExpectationValueToActionReturnType() throws Exception { Call call = new Call(new StaticInvocation(calculator, Calculator.SUM)); call.addInput("2", "1"); call.expect("3"); call.execute(); assertTrue(call.wasRight()); }
@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()); }