Пример #1
0
        public void Withdrawal_WithdrawalMoreThan1000Dollars_ArgumentExceptionThrown()
        {
            Account account = new IndividualInvestment(new AccountHolder("Obi-Wan", "Kenobi"));

            account.Deposit(2000);
            account.Withdrawal(1001, "Kroger");
        }
Пример #2
0
        public void Withdrawal_AmountLargerThanAccountBalance_ArgumentExceptionThrown()
        {
            Account account = new IndividualInvestment(new AccountHolder("Obi-Wan", "Kenobi"));

            account.Deposit(50);
            account.Withdrawal(100, "Kroger");
        }
Пример #3
0
        public void Transfer_TransferAmountGreaterThanFromAccountBalance_ArgumentExceptionThrown()
        {
            Account account1 = new IndividualInvestment(new AccountHolder("Obi-Wan", "Kenobi"));
            Account account2 = new CorporateInvestment(new AccountHolder("Luke", "Skywalker"));

            account1.Deposit(15);
            account2.Deposit(50);
            account1.Transfer(25, account2);
        }
Пример #4
0
        public void Deposit_AmountSmallerThanAccountBalance_AccountBalanceEquals20()
        {
            Account account = new IndividualInvestment(new AccountHolder("Obi-Wan", "Kenobi"));

            account.Deposit(50);

            float accountBalance = account.AccountBalance;

            Assert.AreEqual(50, accountBalance);
        }
Пример #5
0
        public void Withdrawal_AccountBalanceIsMade0_AccountBalanceEquals0()
        {
            Account account = new IndividualInvestment(new AccountHolder("Obi-Wan", "Kenobi"));

            account.Deposit(50);
            account.Withdrawal(50, "Kroger");

            float accountBalance = account.AccountBalance;

            Assert.AreEqual(0, accountBalance);
        }
        public void Transfer_FromAccountBalanceLessThanOriginalBalance_AccountBalanceEquals25()
        {
            Account account1 = new CorporateInvestment(new AccountHolder("Obi-Wan", "Kenobi"));
            Account account2 = new IndividualInvestment(new AccountHolder("Luke", "Skywalker"));

            account1.Deposit(50);
            account2.Deposit(50);
            account1.Transfer(25, account2);

            float accountBalance = account1.AccountBalance;

            Assert.AreEqual(25, accountBalance);
        }
Пример #7
0
        public void Transfer_ToAccountBalanceGreaterThanOriginalBalance_AccountBalanceEquals75()
        {
            Account account1 = new Checking(new AccountHolder("Obi-Wan", "Kenobi"));
            Account account2 = new IndividualInvestment(new AccountHolder("Luke", "Skywalker"));

            account1.Deposit(50);
            account2.Deposit(50);
            account1.Transfer(25, account2);

            float accountBalance = account2.AccountBalance;

            Assert.AreEqual(75, accountBalance);
        }
Пример #8
0
        public void Transfer_FromAccountBalanceIsMade0_AccountBalanceEquals0()
        {
            Account account1 = new Checking(new AccountHolder("Obi-Wan", "Kenobi"));
            Account account2 = new IndividualInvestment(new AccountHolder("Luke", "Skywalker"));

            account1.Deposit(50);
            account2.Deposit(50);
            account1.Transfer(50, account2);

            float accountBalance = account1.AccountBalance;

            Assert.AreEqual(0, accountBalance);
        }
Пример #9
0
        public void OpenAccount(AccountHolder owner, float beginningBalance, AccountType accountType)
        {
            switch (accountType)
            {
            case AccountType.Checking:
                Account newCheckingAccount = new Checking(owner);
                newCheckingAccount.Deposit(beginningBalance);
                accounts.Add(newCheckingAccount);
                break;

            case AccountType.CorperateInvestment:
                Account newCorperateInvestmentAccount = new CorporateInvestment(owner);
                newCorperateInvestmentAccount.Deposit(beginningBalance);
                accounts.Add(newCorperateInvestmentAccount);
                break;

            case AccountType.IndividualInvestment:
                Account newIndividualInvestmentAccount = new IndividualInvestment(owner);
                newIndividualInvestmentAccount.Deposit(beginningBalance);
                accounts.Add(newIndividualInvestmentAccount);
                break;
            }
        }