def testTransferCommandExecuteWithInsufficientBalance(self):
     try:
         transfer = Transaction(from_account=self.ac4, to_account=self.ac3, amount=11)
         cmd = TransferCommand(transfer)
         cmd.execute()
         self.assertTrue(False, 'Exception should be raised')
     except FromAccountInsufficientBalanceError:
         pass
 def testTransferCommandExecuteWithSameAccount(self):
     try:
         transfer = Transaction(from_account=self.ac1, to_account=self.ac1, amount=1)
         cmd = TransferCommand(transfer)
         cmd.execute()
         self.assertTrue(False, 'Exception should be raised')
     except SameAccountError:
         pass
 def testTransferCommandExecuteSuccess(self):
     try:
         transfer = Transaction(from_account=self.ac1, to_account=self.ac3, amount=10)
         cmd = TransferCommand(transfer)
         cmd.execute()
         self.assertEquals(self.ac1.balance, 190)
         self.assertEquals(self.ac3.balance, 510)
          
     except Exception as e:
         self.assertTrue(False, "Exception shouldn't be raised: %s" % e)