Example #1
0
 public void Transfer(Account sender, Account recipient, decimal amount, string transactionId)
 {
     try
     {
         sender.Withdraw(amount);
     }
     catch (NotEnoughFundsException notEnoughFundsException)
     {
         _notifier.NotifyFailure(transactionId, notEnoughFundsException.Message);
         return;
     }
     recipient.Deposit(amount);
     _notifier.NotifySuccess(transactionId);
 }
Example #2
0
 public void AuditSystemWasNotifiedAboutSuccess() =>
 A.CallTo(() => _transactionNotifications.NotifySuccess(
              A <string> .That.Matches(x => x == transactionId)))
 .MustHaveHappened();