Example #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;
 }
Example #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;
 }
Example #3
0
 private SavingsAccount createSavingsAccount(
     String accountNumber, String accountName, AccountManager manager) {
   SavingsAccount account = new SavingsAccount(accountNumber, accountName);
   manager.deposit(account, 100);
   return account;
 }