//[Ignore]
 public void TestThreeAccounts()
 {
     Customer oscar = new Customer("Oscar")
             .OpenAccount(new Account(Account.SAVINGS));
     oscar.OpenAccount(new Account(Account.CHECKING));
     oscar.OpenAccount(new Account(Account.MAXI_SAVINGS));
     Assert.AreEqual(3, oscar.GetNumberOfAccounts());
 }
        public void TestTransferFunds()
        {
            Customer oscar = new Customer("Oscar");
            IAccount oscarsChecking = new CheckingAccount(); //Account(Account.CHECKING);
            IAccount oscarsSavings = new SavingsAccount();
            oscar.OpenAccount(oscarsChecking);
            oscarsChecking.Deposit(100.0);
            oscar.OpenAccount(oscarsSavings);

            oscar.TransferFunds(oscarsChecking, oscarsSavings, 100);
            Assert.AreEqual(0, oscarsChecking.sumTransactions());
        }
 public void TestTwoAccount()
 {
     Customer oscar = new Customer("Oscar")
          .OpenAccount(new SavingsAccount());
     oscar.OpenAccount(new CheckingAccount());
     Assert.AreEqual(2, oscar.GetNumberOfAccounts());
 }
        public void TestTransferMoney()
        {
            Customer oscar = new Customer("Oscar");
            Account savings = new Account(Account.SAVINGS);
            Account checkings =new Account(Account.CHECKING);
            oscar.OpenAccount(savings);
            oscar.OpenAccount(checkings);

            savings.Deposit(4000);
            checkings.Deposit(500);

            oscar.transfer(checkings, savings, 500);
            
            Assert.AreEqual(3500, savings.getBalance());
            Assert.AreEqual(1000, checkings.getBalance());
        }
        public void CustomerSummary() 
        {
            Bank bank = new Bank();
            Customer john = new Customer("John");
            john.OpenAccount(new Account(Account.CHECKING));
            bank.AddCustomer(john);

            Assert.AreEqual("Customer Summary\n - John (1 account)", bank.CustomerSummary());
        }
 public void TestMoneyTransfer()
 {
     Account maxiAccount = new Account(Account.MAXI_SAVINGS);
     Customer oscar = new Customer("Oscar").OpenAccount(savingsAccount);
     oscar.OpenAccount(maxiAccount);
     savingsAccount.Deposit(1500.0);
     maxiAccount.Deposit(3000.0);
     Assert.AreEqual(oscar, oscar.IntraAccountTransfer(maxiAccount, savingsAccount, 500));
 }
Beispiel #7
0
        public void CustomerSummary() 
        {
           // Bank bank = new Bank();
            Customer john = new Customer("John");
            john.OpenAccount(new Account(Account.CHECKING));
            bank.AddCustomer(john);

            Customer mike = new Customer("Mike");
            mike.OpenAccount(new Account(Account.SAVINGS));
            bank.AddCustomer(mike);

            Assert.AreEqual("Customer Summary\n - John (1 account)\n - Mike (1 account)", bank.CustomerSummary());
        }
Beispiel #8
0
        public void TotalInterestPaid() {
            //Bank bank = new Bank();
            Account checkingAccount = new Account(Account.CHECKING);
            Customer bill = new Customer("Bill").OpenAccount(checkingAccount);
            bank.AddCustomer(bill);

            checkingAccount.Deposit(100.0);
           
            Account savingsAccount = new Account(Account.SAVINGS);
            savingsAccount.Deposit(1500.0);
            bill.OpenAccount(savingsAccount);

            Assert.AreEqual(2.1, bank.totalInterestPaid(), DOUBLE_DELTA);
        }