/// <inheritdoc /> public void PrintResponseToLoanRequest(ResponseToLoanRequest responseToLoanRequest) { if (responseToLoanRequest.ValidLoanRequest.IsValid) { //print result System.Console.WriteLine("Requested amount: £{0}", responseToLoanRequest.Quote.RequestedAmount); System.Console.WriteLine("Rate: {0}%", responseToLoanRequest.Quote.Rate); System.Console.WriteLine("Monthly repayment: £{0}", responseToLoanRequest.Quote.MonthlyRepayment); System.Console.WriteLine("Total repayment: £{0}", responseToLoanRequest.Quote.TotalRepyment); } else { //print errors foreach (var error in responseToLoanRequest.ValidLoanRequest.ErrorMessages) { System.Console.WriteLine(error); } } }
public void can_print_response_to_loan_request() { var responseToLoanRequest = new ResponseToLoanRequest(new Quote(new decimal(12), 12, new decimal(58), new decimal(96)), new ValidLoanRequest(new List<string>(), false )); _printService.PrintResponseToLoanRequest(responseToLoanRequest); }