public void verify_that_print_call_the_printer() { List <HistoryLine> SetupHistoryMock(Id id) { List <HistoryLine> list = new List <HistoryLine>(); historyMock.Setup(history => history.Get(id)) .Returns(list); return(list); } Id accountId = new Id("toto"); SetupCardReader(accountId); List <HistoryLine> historyLines = SetupHistoryMock(accountId); string formattedHistory = SetupStringFormatMock(historyLines); Atm atm = new Atm(printerMock.Object, null, cardReaderMock.Object, historyMock.Object, formatterMock.Object); atm.Print(); printerMock.Verify(printer => printer.Print(formattedHistory)); }