예제 #1
0
        public void TransferFunds(Account from, Account to, double amount)
        {
            if (from.Balance < amount)
            {
                throw new ArgumentException($"Error, the transfer amount {amount} cannot be higher than the remaining balance {from.Balance}");
            }

            from.Debit(amount);
            to.Credit(amount);
            _emailGateway.SendEmail("Funds transferred", "*****@*****.**", $"The amount {amount} has been transferred into your account");
        }