Execute() public méthode

public Execute ( ) : void
Résultat void
        public void MakeWithdraw_Return_AvaliableBalance_Valid()
        {
            withdrawal = new Withdrawal(20.0, DateTime.Now, account, bank);

            var result = withdrawal.Execute();

            Assert.Equal(103, bank.GetAvaliableBalance(account.Id));
        }
        public void MakeWithdraw_Return_Withdraw_Not_Realized()
        {
            withdrawal = new Withdrawal(500.0, DateTime.Now, account, bank);

            int result = withdrawal.Execute();

            Assert.Equal(0, result);
        }
Exemple #3
0
        private bool WithdrawalMade(Withdrawal withdrawal)
        {
            var result = withdrawal.Execute();

            if (result <= 0)
            {
                _notifiable.AddNotification(new Notification("Failed to withdraw"));
                return(false);
            }
            return(true);
        }