diff --git a/chapter5/bankService/SavingsAccountTest.java b/chapter5/bankService/SavingsAccountTest.java index e16b4dc..eba9799 100644 --- a/chapter5/bankService/SavingsAccountTest.java +++ b/chapter5/bankService/SavingsAccountTest.java @@ -56,3 +56,12 @@ private Object[][] createValidWithdrawData() { */ @Test public void withdrawingAmountGreaterThanBalance_Throws_InsufficientFundsException() throws InsufficientFundsException { + try { + savings.withdraw(200.00); + fail("Expected Insufficient Funds Exception but none is thrown"); + } catch (InsufficientFundsException e){ + // Then + assertEquals(savings.getBalance(), 100.00); + } + } +}