public IEnumerable <PaymentOverviewResponse> Get(double loanAmount = 500000, double loanDuration = 10) { var danish = new System.Globalization.CultureInfo("da-DK"); var yearOrYears = loanDuration > 1 ? "years" : "year"; return(Enumerable.Range(1, 1).Select(overview => new PaymentOverviewResponse { YearlyCost = _loanService.AnnualPercentageYield().ToString("P"), MonthlyCost = _loanService.MonthlyCost(loanAmount, loanDuration).ToString("C", danish), TotalAmountPaid = new TotalAmountPaid { InterestRate = _loanService.TotalAmountPaidInterestRate(loanAmount, loanDuration).ToString("C", danish), AdministrationFees = _loanService.AdministrationFee(loanAmount).ToString("C", danish) }, Request = new RequestParameters { LoanAmount = loanAmount.ToString("C", danish), LoanDuration = $"{loanDuration} {yearOrYears}" } })); }
public void CalculateAdministrationFeeTest(double loanAmount) { var result = _service.AdministrationFee(loanAmount); Assert.True(result <= _configuration.AdministrationFeeAmount()); }