/// <summary> /// Makes a deposit of <paramref name="amount"/> to an account with specified <paramref name="iban"/>. /// </summary> /// <param name="iban">IBAN of an account to make deposit</param> /// <param name="amount">deposit amount</param> /// <returns>new account balance</returns> /// <exception cref="ArgumentException">deposit amount is lesser than minimal</exception> public decimal MakeDeposit(string iban, decimal amount) { if (string.IsNullOrWhiteSpace(iban)) { throw new ArgumentException("No IBAN is given.", "IBAN"); } if (amount < MINDEPOSIT) { throw new ArgumentException("Minimum deposit amount is " + MINDEPOSIT.ToString("C")); } var account = storage.GetAccount(iban); account.Balance += amount; account.BonusPoints += calculator.CalculateDepositPoints(account, amount); storage.SaveAccount(account); return(account.Balance); }