public void ExecuteShould_CallReporterGenerateReportOnce() { var reporterMock = new Mock <IReportGenerator>(); var loggerMock = new Mock <ILogger>(); var command = new CreateRankingPdf(reporterMock.Object, loggerMock.Object); string result = command.Execute(new List <string>()); reporterMock.Verify(x => x.GenerateReport(PdfReportType.Ranking), Times.Once); }
public void ExecuteShould_CallLoggerLogOnce() { var reporterMock = new Mock <IReportGenerator>(); var loggerMock = new Mock <ILogger>(); var command = new CreateRankingPdf(reporterMock.Object, loggerMock.Object); string result = command.Execute(new List <string>()); loggerMock.Verify(x => x.Log("Successfully created ranking report"), Times.Once); }
public void ExecuteShould_ReturnSuccess_WhenReporterAndLoggerAreValid() { var reporterMock = new Mock <IReportGenerator>(); var loggerMock = new Mock <ILogger>(); var command = new CreateRankingPdf(reporterMock.Object, loggerMock.Object); string result = command.Execute(new List <string>()); Assert.That(result.Contains("Successfully created ranking report")); }