示例#1
0
        public void TryWithdraw()
        {
            var customerToTest = BankRepostitory.CustomerList[0];
            var initialBalance = customerToTest.CustomerAccounts[0].Balance;

            BankRepo.BankWithdraw(customerToTest.CustomerAccounts[0].AccountNumber, 100);

            Assert.Equal(initialBalance - 100, customerToTest.CustomerAccounts[0].Balance);
        }
        public IActionResult DepositOrWithdraw(string btn, BankActionIndexViewModel vm)
        {
            string result;

            if (btn.Length > 5)
            {
                result = BankRepo.BankDeposit(vm.AccountNumber, vm.Amount);
            }
            else
            {
                result = BankRepo.BankWithdraw(vm.AccountNumber, vm.Amount);
            }

            var newVm = new BankActionIndexViewModel()
            {
                Message = result
            };

            return(View("Index", newVm));
        }