예제 #1
0
        public void SavingsAccountTest_InterestEarned_Less_Than_A_Thousand()
        {
            IAccount savingsAccount = new SavingsAccount();

            savingsAccount.Deposit(450.75m);
            savingsAccount.Deposit(120.50m);
            savingsAccount.Withdraw(4.60m);

            Assert.AreEqual(.56665m, savingsAccount.InterestEarned());
        }
예제 #2
0
        public void SavingAccountTest_SumTransactions()
        {
            IAccount savingsAccount = new SavingsAccount();

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

            Assert.AreEqual(566.40m, savingsAccount.SumTransactions());
        }
예제 #3
0
        public void TestApp()
        {
            CheckingAccount checkingAccount = new CheckingAccount();
            SavingsAccount savingsAccount = new SavingsAccount();

            Customer henry = new Customer("Henry").OpenAccount(checkingAccount).OpenAccount(savingsAccount);

            checkingAccount.Deposit(100.0m);
            savingsAccount.Deposit(4000.0m);
            savingsAccount.Withdraw(200.0m);

            var actual = henry.GetStatement();
            var expected = "Statement for HENRY" + Environment.NewLine +
                    Environment.NewLine +
                    "Checking Account" + Environment.NewLine +
                    "  deposit $100.00" + Environment.NewLine +
                    "Total $100.00" + Environment.NewLine +
                    Environment.NewLine +
                    "Savings Account" + Environment.NewLine +
                    "  deposit $4,000.00" + Environment.NewLine +
                    "  withdrawal $200.00" + Environment.NewLine +
                    "Total $3,800.00" + Environment.NewLine +
                    Environment.NewLine +
                    "Total In All Accounts: $3,900.00";

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void SavingsAccountTest_InterestEarned_More_Than_A_Thousand()
        {
            IAccount savingsAccount = new SavingsAccount();

            savingsAccount.Deposit(1200);
            var actual = savingsAccount.InterestEarned();

            Assert.AreEqual(1.4m, actual);
        }
예제 #5
0
파일: BankTest.cs 프로젝트: zmosk/ABC-Bank
        public void SavingsAccount()
        {
            Bank bank = new Bank();
            SavingsAccount savingsAccount = new SavingsAccount();
            bank.AddCustomer(new Customer("Bill").OpenAccount(savingsAccount));

            savingsAccount.Deposit(1500.0m);

            Assert.AreEqual(2.0m, bank.totalInterestPaid());
        }
예제 #6
0
        public void Savings_account()
        {
            Bank bank = new Bank();
            IAccount checkingAccount = new SavingsAccount();//Account(Account.SAVINGS);
            bank.AddCustomer(new Customer("Bill").OpenAccount(checkingAccount));

            checkingAccount.Deposit(1500.0);

            Assert.AreEqual(2.0, bank.totalInterestPaid(), DOUBLE_DELTA);
        }
예제 #7
0
        public void TestApp()
        {
            IAccount checkingAccount = new CheckingAccount(); //Account(Account.CHECKING);
            IAccount savingsAccount = new SavingsAccount();//Account(Account.SAVINGS);

            Customer henry = new Customer("Henry").OpenAccount(checkingAccount).OpenAccount(savingsAccount);

            checkingAccount.Deposit(100.0);
            savingsAccount.Deposit(4000.0);
            savingsAccount.Withdraw(200.0);

            Assert.AreEqual("Statement for Henry\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", henry.GetStatement());
        }