예제 #1
0
        public void CheckingAccountTest_InterestEarned_More_Than_A_Thousand()
        {
            IAccount checkingAccount = new CheckingAccount();

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

            Assert.AreEqual(2.37607m, checkingAccount.InterestEarned());
        }
예제 #2
0
        public void CheckingAccountTest_SumTransactions()
        {
            IAccount checkingAccount = new CheckingAccount();

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

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

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

            Assert.AreEqual(.5664m, checkingAccount.InterestEarned());
        }
예제 #4
0
        public void AccountTest_Withdraw_More_Than_Account_Balance()
        {
            IAccount account = new CheckingAccount();
            account.Deposit(100);

            try
            {
                account.Withdraw(150);
            }
            catch (ArgumentException ae)
            {
                Assert.AreEqual(ae.Message, "cannot withdraw more than current account balance");
                return;
            }

            Assert.Fail("No exception was thrown");
        }