@Test public void checkAccountActivityWithdrawal() { Account a = new Account(Account.CHECKING); a.deposit(10); a.withdraw(5); assertFalse(a.accountInactive()); }
@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); }
@Test public void checkAccountActivityDeposit() { Account a = new Account(Account.CHECKING); a.deposit(10); assertTrue(a.accountInactive()); }
@Test(expected = IllegalArgumentException.class) public void testWithdrawIllegalArgumentException() { Account a = new Account(Account.SAVINGS); a.withdraw(-2); }
@Test(expected = IllegalArgumentException.class) public void testDepositIllegalArgumentException() { Account a = new Account(Account.SAVINGS); a.deposit(-2); }