Esempio n. 1
0
 /** Test withdraw method. */
 public final void testWithdraw() {
   BigDecimal balance = new BigDecimal("70.01");
   try {
     assertEquals(a1.withdraw(new BigDecimal("30.24")), balance);
   } catch (InsufficientFundsException ex) {
     ex.printStackTrace();
   }
   try {
     // withdraw too much
     a1.withdraw(new BigDecimal("10000.00"));
     fail("witdhraw hasn't caused an exception when it should");
   } catch (InsufficientFundsException ex) {
     System.out.println("Caught Insufficient Funds exception as expected");
   }
 } // testWithdraw