[TestCase("33333", "Basic Account", 100, AccountType.Basic, -150, -60, true)]     //success with overdraft fee
        public void BasicAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType type, decimal amount, decimal newBalance, bool expectedResult)
        {
            IWithdraw withdraw = new BasicAccountWithdrawRules();
            Account   account  = new Account()
            {
                AccountNumber = accountNumber,
                Name          = name,
                Balance       = balance,
                Type          = type,
            };
            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
        }
Exemplo n.º 2
0
        public void BasicAccountWithdrawRuleTest(string accountNumber, string name, decimal balance,
                                                 AccountType accountType, decimal amount, decimal newBalance, bool expectedResult)
        {
            IWithdrawl withdraw = new BasicAccountWithdrawRules();

            Account account = new Account();

            account.AccountNumber = accountNumber;
            account.Name          = name;
            account.Balance       = balance;
            account.Type          = accountType;

            AccountWithdrawlResponse response = withdraw.Withdrawl(account, amount);

            Assert.AreEqual(response.Success, expectedResult);
            Assert.AreEqual(account.Balance, newBalance);
        }