コード例 #1
0
ファイル: AccountTest.java プロジェクト: CrekTek/my-bank
 @Test
 public void checkAccountActivityWithdrawal() {
   Account a = new Account(Account.CHECKING);
   a.deposit(10);
   a.withdraw(5);
   assertFalse(a.accountInactive());
 }
コード例 #2
0
ファイル: AccountTest.java プロジェクト: CrekTek/my-bank
  @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);
  }
コード例 #3
0
  @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);
  }
コード例 #4
0
  @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);
  }
コード例 #5
0
ファイル: AccountTest.java プロジェクト: CrekTek/my-bank
 @Test
 public void checkAccountActivityDeposit() {
   Account a = new Account(Account.CHECKING);
   a.deposit(10);
   assertTrue(a.accountInactive());
 }
コード例 #6
0
ファイル: AccountTest.java プロジェクト: CrekTek/my-bank
 @Test(expected = IllegalArgumentException.class)
 public void testWithdrawIllegalArgumentException() {
   Account a = new Account(Account.SAVINGS);
   a.withdraw(-2);
 }
コード例 #7
0
ファイル: AccountTest.java プロジェクト: CrekTek/my-bank
 @Test(expected = IllegalArgumentException.class)
 public void testDepositIllegalArgumentException() {
   Account a = new Account(Account.SAVINGS);
   a.deposit(-2);
 }