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}"
                }
            }));
        }
Exemplo n.º 2
0
        public void AnnualPercentageYieldTest()
        {
            var result = _service.AnnualPercentageYield();

            Assert.True(result > 0);
        }