public void print_an_error_message() { var quotePrinter = new QuotePrinter(console.Object); quotePrinter.PrintError(anErrorMessage); console.Verify(a => a.WriteLine(anErrorMessage)); }
public void print_a_repayment_details_quote() { var repayment = new Repayment(principal, monthlyRepayment, totalRepayment, annualInterestRate); var quotePrinter = new QuotePrinter(console.Object); quotePrinter.PrintQuote(repayment); console.Verify(a => a.WriteLine("Requested amount: £1")); console.Verify(a => a.WriteLine("Rate: 10.0%")); console.Verify(a => a.WriteLine("Monthly repayment: £2.22")); console.Verify(a => a.WriteLine("Total repayment: £3333.33")); }
public void display_a_loan_quote_for_monthly_compunding_interests() { var quotePrinter = new QuotePrinter(console.Object); var interestCalculation = new MonthlyCompoundingInterest(); var lenderMarket = new LenderMarket(interestCalculation); var loanCalculator = new LoanCalculator(inputValidator.Object, quotePrinter, new CsvFileMarketDataSource(), lenderMarket, interestCalculation); loanCalculator.GetQuoteFor(MonthlyPayments, inputParameters); console.Verify(a => a.WriteLine("Requested amount: �00")); console.Verify(a => a.WriteLine("Rate: 7.0%")); console.Verify(a => a.WriteLine("Monthly repayment: �.88")); console.Verify(a => a.WriteLine("Total repayment: �11.64")); }