public string FormatBorrowerQuote(BorrowerQuote quote) { return($@"Requested amount: £{quote.Amount} Rate: {quote.Rate*100:0.0}% Monthly repayment: £{quote.MonthlyRepayment:0.00} Total repayment: £{quote.TotalRepayment:0.00}"); }
public void GivenAQuote_WhenItIsValid_ThenFormatAResponse() { var quote = new BorrowerQuote() { Amount = 1000, MonthlyRepayment = 30.78111111M, TotalRepayment = 1108.10101010101M, Rate = 0.07M }; var output = _loanFormatterService.FormatBorrowerQuote(quote); output.ShouldContain("Requested amount: £1000"); output.ShouldContain("Rate: 7.0%"); output.ShouldContain("Monthly repayment: £30.78"); output.ShouldContain("Total repayment: £1108.10"); }