Пример #1
0
        public void PremiumAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, bool expectedResult)
        {
            IWithdraw withdraw = new PremiumAccountWithdrawRules();
            Account   account  = new Account()
            {
                AccountNumber = accountNumber, accountType = accountType, Balance = amount
            };
            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
        }
Пример #2
0
        public void BasicAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType type, decimal amount, bool expectedResult)
        {
            IWithdraw withdraw = new PremiumAccountWithdrawRules();
            Account   account  = new Account();

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

            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
        }
Пример #3
0
        public void PremiumAccountWithdrawtRuleTest(string accountNumber, string name, decimal balance,
                                                    AccountType accountType, decimal amount, decimal newBalance, bool expectedResult)
        {
            IWithdraw withdraw = new PremiumAccountWithdrawRules();
            Account   account  = new Account();

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

            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
            if (response.Success == true)
            {
                Assert.AreEqual(newBalance, actual: account.Balance);
            }
        }