public void MaxiSavingsAccountTest_InterestEarned_FivePercent_Rates_More_Than_A_Thousand()
        {
            IAccount maxiSavingsAccount = new MaxiSavingsAccount(new MaxiSavingsAccountFivePercentInterestStrategy());

            maxiSavingsAccount.Deposit(250.75m);
            maxiSavingsAccount.Deposit(120.25m);

            Assert.AreEqual(18.55m, maxiSavingsAccount.InterestEarned());
        }
        public void MaxiSavingsAccountTest_InterestEarned_More_Than_Two_Thousand()
        {
            IAccount maxiSavingsAccount = new MaxiSavingsAccount();

            maxiSavingsAccount.Deposit(950.75m);
            maxiSavingsAccount.Deposit(1520.32m);
            maxiSavingsAccount.Withdraw(95.00m);

            Assert.AreEqual(107.607m, maxiSavingsAccount.InterestEarned());
        }
        public void MaxiSavingsAccountTest_InterestEarned_More_Than_A_Thousand()
        {
            IAccount maxiSavingsAccount = new MaxiSavingsAccount();

            maxiSavingsAccount.Deposit(150.0m);
            maxiSavingsAccount.Deposit(1520.0m);
            maxiSavingsAccount.Withdraw(95.0m);

            Assert.AreEqual(48.75m, maxiSavingsAccount.InterestEarned());
        }
        public void MaxiSavingsAccountTest_InterestEarned_Less_Than_A_Thousand()
        {
            IAccount maxiSavingsAccount = new MaxiSavingsAccount();

            maxiSavingsAccount.Deposit(500m);
            maxiSavingsAccount.Deposit(200m);
            maxiSavingsAccount.Withdraw(100m);

            Assert.AreEqual(12, maxiSavingsAccount.InterestEarned());
        }
Beispiel #5
0
        public void Maxi_savings_account()
        {
            Bank bank = new Bank();
            IAccount checkingAccount = new MaxiSavingsAccount();//Account(Account.MAXI_SAVINGS);

            bank.AddCustomer(new Customer("Bill").OpenAccount(checkingAccount));

            checkingAccount.Deposit(3000.0);

            Assert.AreEqual(3.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
Beispiel #6
0
        public void MaxiSavingsAccount()
        {
            Bank bank = new Bank();
            MaxiSavingsAccount maxiSavingsAccount = new MaxiSavingsAccount();
            bank.AddCustomer(new Customer("Bill").OpenAccount(maxiSavingsAccount));

            maxiSavingsAccount.Deposit(3000.0m);
            Assert.AreEqual(170, bank.totalInterestPaid());

            // change the interest strategy
            maxiSavingsAccount.SetInterestStrategy(new MaxiSavingsAccountFivePercentInterestStrategy());
            Assert.AreEqual(150, bank.totalInterestPaid());
        }
        public void MaxiSavingsAccountTest_SumTransactions()
        {
            IAccount maxiSavingsAccount = new MaxiSavingsAccount();

            maxiSavingsAccount.Deposit(450.75m);
            maxiSavingsAccount.Deposit(120.32m);
            maxiSavingsAccount.Withdraw(4.67m);

            Assert.AreEqual(566.40m, maxiSavingsAccount.SumTransactions());
        }