Exemplo n.º 1
0
 public void testTwoAccount()
 {
     Customer Mike = new Customer("Mike")
             .openAccount(new Account(Account.SAVINGS));
     Mike.openAccount(new Account(Account.CHECKING));
     Assert.AreEqual(2, Mike.getNumberOfAccounts());
 }
Exemplo n.º 2
0
        public void customerSummary()
        {
            Bank bank = new Bank();
            Customer Bob = new Customer("Bob");
            Bob.openAccount(new Account(Account.CHECKING));
            bank.addCustomer(Bob);

            Assert.AreEqual("Customer Summary\n - Bob (1 account)", bank.customerSummary());
        }
Exemplo n.º 3
0
        public void checkingAccount()
        {
            Bank bank = new Bank();
            Account checkingAccount = new Account(Account.CHECKING);
            Customer Steve = new Customer("Steve").openAccount(checkingAccount);
            bank.addCustomer(Steve);

            checkingAccount.deposit(100.0);

            Assert.AreEqual(0.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
Exemplo n.º 4
0
        public void testApp()
        {
            Account checkingAccount = new Account(Account.CHECKING);
            Account savingsAccount = new Account(Account.SAVINGS);

            Customer Steve = new Customer("Steve").openAccount(checkingAccount).openAccount(savingsAccount);

            checkingAccount.deposit(100.0);
            savingsAccount.deposit(4000.0);
            savingsAccount.withdraw(200.0);

            Assert.AreEqual("Statement for Steve\n" +
                    "\n" +
                    "Checking Account\n" +
                    "  deposit $100.00\n" +
                    "Total $100.00\n" +
                    "\n" +
                    "Savings Account\n" +
                    "  deposit $4,000.00\n" +
                    "  withdrawal $200.00\n" +
                    "Total $3,800.00\n" +
                    "\n" +
                    "Total In All Accounts $3,900.00", Steve.getStatement());
        }
Exemplo n.º 5
0
 public void addCustomer(Customer customer)
 {
     customers.Add(customer);
 }
Exemplo n.º 6
0
 public void testOneAccount()
 {
     Customer Mike = new Customer("Mike").openAccount(new Account(Account.SAVINGS));
     Assert.AreEqual(1, Mike.getNumberOfAccounts());
 }