Example #1
0
 @Test
 public void checkAccountActivityWithdrawal() {
   Account a = new Account(Account.CHECKING);
   a.deposit(10);
   a.withdraw(5);
   assertFalse(a.accountInactive());
 }
Example #2
0
  @Test
  public void testTransactions() {
    Account a = new Account(Account.SAVINGS);
    a.deposit(100.5);
    a.withdraw(50.5);
    double balance = a.sumTransactions();

    assertEquals(50.0, balance, DOUBLE_DELTA);
  }
  @Test
  public void maxi_savings_account() {
    Bank bank = new Bank();
    Account checkingAccount = new Account(Account.MAXI_SAVINGS);
    bank.addCustomer(new Customer("Bill").openAccount(checkingAccount));

    checkingAccount.deposit(3000.0);

    assertEquals(170.0, bank.totalInterestPaid(), DOUBLE_DELTA);
  }
  @Test
  public void checkingAccount() {
    Bank bank = new Bank();
    Account checkingAccount = new Account(Account.CHECKING);
    Customer bill = new Customer("Bill").openAccount(checkingAccount);
    bank.addCustomer(bill);

    checkingAccount.deposit(100.0);

    assertEquals(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
  }
Example #5
0
 @Test
 public void checkAccountActivityDeposit() {
   Account a = new Account(Account.CHECKING);
   a.deposit(10);
   assertTrue(a.accountInactive());
 }
Example #6
0
 @Test(expected = IllegalArgumentException.class)
 public void testWithdrawIllegalArgumentException() {
   Account a = new Account(Account.SAVINGS);
   a.withdraw(-2);
 }
Example #7
0
 @Test(expected = IllegalArgumentException.class)
 public void testDepositIllegalArgumentException() {
   Account a = new Account(Account.SAVINGS);
   a.deposit(-2);
 }