예제 #1
0
        public void DoTransfer(float creditAmount, float debitAmount)
        {
            accountCreditDao.CreateCredit(creditAmount);

            if (creditAmount > maxTransferAmount || debitAmount > maxTransferAmount)
            {
                throw new ArithmeticException("see a teller big spender...");
            }

            accountDebitDao.DebitAccount(debitAmount);
        }
 public void DoTransfer(float creditAmount, float debitAmount)
 {
     creditDao.CreateCredit(creditAmount);
     if (ThrowException)
     {
         throw new ArithmeticException("Couldn't do the math....");
     }
     debitDao.DebitAccount(debitAmount);
     if (AuditDao != null)
     {
         AuditDao.AuditOperation(DateTime.Now.ToString());
     }
     if (ThrowExceptionAtEnd)
     {
         throw new ArgumentException("Almost there...but not quite.");
     }
 }
예제 #3
0
 public void DoTransfer(float creditAmount, float debitAmount)
 {
     creditDao.CreateCredit(creditAmount);
     debitDao.DebitAccount(debitAmount);
 }