Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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"));
        }