public void BasicAccountDepositRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, bool expectedResult)
        {
            IDeposit deposit = new NoLimitDepositRules();
            Account  account = new Account()
            {
                AccountNumber = accountNumber,
                Balance       = balance,
                Name          = name,
                Type          = accountType
            };

            AccountDepositResponse accountDepositResponse = deposit.Deposit(account, amount);

            Assert.AreEqual(expectedResult, accountDepositResponse.Success);
        }
Example #2
0
        public void CanDepositToPremiumAccount(string accountNumber, string accountName, AccountType accountType, decimal balance, decimal amount, bool expected)
        {
            IDeposit depost  = new NoLimitDepositRules();
            Account  account = new Account
            {
                AccountNumber = accountNumber,
                Balance       = balance,
                Name          = accountName,
                Type          = accountType
            };

            AccountDepositResponse accountDepositResponse = depost.Deposit(account, amount);

            Assert.AreEqual(expected, accountDepositResponse.Success);
        }
Example #3
0
        [TestCase("33333", "Premium Account", 1000, AccountType.Premium, 100, 1100, true)] //Success
        public void PremiumAccountDepositRuleTest(string accountNumber, string name, decimal balance,
                                                  AccountType accountType, decimal amount, decimal newBalance, bool expectedResult)
        {
            IDeposit deposit = new NoLimitDepositRules();

            Account account = new Account();

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

            AccountDepositResponse response = deposit.Deposit(account, amount);

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