public void Visit(Account account) { AccountValidator.ValidateNumber(account.number); var interest = 6; account.Balance += ((account.Balance / 100) * interest); }
public void AddAccount(Account account) { if (account == null) { throw new ArgumentException("Account try to add is null"); } this.accounts.Add(account); }
public void Visit(Account account) { if (account == null) { throw new ArgumentNullException("Account cannot be null"); } AccountValidator.ValidateNumber(account.number); account.Balance += this.sum; }
public static void ValidateWithDrawOperation(Account account, decimal sum) { if (account.IsSavingAccount) { throw new ArgumentException("Cannot withdraw from saving account"); } if (account.Balance - sum < 0) { throw new ArgumentException("Account does not have enough money"); } }