public void FreeAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, bool expectedResult) { IWithdraw withdraw = new FreeAccountWithdrawlRules(); Account account = new Account() { AccountNumber = accountNumber, Balance = balance, Name = name, Type = accountType }; AccountWithdrawResponse accountDepositResponse = withdraw.Withdraw(account, amount); Assert.AreEqual(expectedResult, accountDepositResponse.Success); }
public void FreeAccountWithdrawlRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, decimal newBalance, bool expectedResult) { IWithdrawl test = new FreeAccountWithdrawlRules(); Account newAcct = new Account(); newAcct.AccountNumber = accountNumber; newAcct.Name = name; newAcct.Balance = balance; newAcct.Type = accountType; AccountWithdrawlResponse response = test.Withdrawl(newAcct, amount); Assert.AreEqual(response.Success, expectedResult); Assert.AreEqual(newAcct.Balance, newBalance); }