Exemple #1
0
            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");
            }
Exemple #2
0
            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");
            }
Exemple #3
0
            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");
            }