public void WhenAccountDoesNotExist_ShouldThrowArgumentException() { Given.AccountDoesNotExist(ToAccount); Func <Task> whenIDeposit = async() => { await SUT.Deposit(DepositAmount, ToAccount); }; whenIDeposit .Then() .Throw <ArgumentException>("because account doesn't exist") .WithMessage($"Account '{ToAccount}' not found"); }
public void WhenAccountDoesNotExist_ShouldThrowArgumentException() { Given.AccountDoesNotExist(FromAccount); Func <Task> whenIWithdraw = async() => { await SUT.Withdraw(WithdrawalAmount, FromAccount, User); }; whenIWithdraw .Then() .Throw <ArgumentException>("because account doesn't exist") .WithMessage($"Account '{FromAccount}' not found"); }
public void WhenFromAccountDoesNotExist_ShouldThrowArgumentException() { Given.AccountDoesNotExist(FromAccount); And.ValidAccountExistsInDatabase(ToAccount); Func <Task> whenITransferMoney = async() => { await SUT.TransferMoney(WithdrawalAmount, FromAccount, ToAccount, User); }; whenITransferMoney .Then() .Throw <ArgumentException>("because account doesn't exist") .WithMessage($"Account '{FromAccount}' not found"); }