예제 #1
0
 private CheckingAccount createCheckingAccountWithRandomTransactions(
     String accountNumber, String accountName, AccountManager manager, Integer target) {
   CheckingAccount account = createCheckingAccount(accountNumber, accountName, manager, true);
   Random random = new Random();
   while (account.getBalance() > target) {
     manager.withdraw(account, 1 + random.nextInt(50));
   }
   return account;
 }
예제 #2
0
 private CheckingAccount createCheckingAccount(
     String accountNumber, String accountName, AccountManager manager, Boolean canOverdraw) {
   CheckingAccount account = new CheckingAccount(accountNumber, accountName, canOverdraw);
   manager.deposit(account, 100);
   return account;
 }
예제 #3
0
 private SavingsAccount createSavingsAccount(
     String accountNumber, String accountName, AccountManager manager) {
   SavingsAccount account = new SavingsAccount(accountNumber, accountName);
   manager.deposit(account, 100);
   return account;
 }