public void Withdraw(string account, decimal amount, string bankingAccount) { _log.Info($"account {account} amount {amount} banking account {bankingAccount}"); _walletRepo.UpdateDelta(account, amount * -1); var fee = _fee.Get(bankingAccount); _bankingAccount.Saving(bankingAccount, amount - fee); }
public void withdrawal_from_wallet_to_banking_account_successfully() { var wallet = new Wallet(_walletRepo, _bankingAccount, _fee, _log); _fee.Get("919").ReturnsForAnyArgs(5m); wallet.Withdraw("joey", 1000m, "919"); _walletRepo.Received(1).UpdateDelta("joey", -1000m); _bankingAccount.Received().Saving("919", 995); }