예제 #1
0
        public void GetAudienceEngagementReport_FileTypeCsv_RecurrenceDaily_NoException()
        {
            // Arrange
            InitilizeGetAudienceEngagementReportTests(FileTypeCsv, ValueRecurrenceTypeDaily);
            var message         = new EmailDirect();
            var constructedBody = String.Empty;
            var report          = new TestAudienceEngagementReport(message, constructedBody, _reportSchedule, DateTime.Today);

            // Act
            var returnResult = report.Execute();

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldContain(SuccessfulResultStringGetAudienceEngagementReport);
            _anyException.ShouldBeFalse();
        }
예제 #2
0
        public void GetAudienceEngagementReport_FileTypeDefault_RecurrenceTypeMonthly_NoData()
        {
            // Arrange
            InitilizeGetAudienceEngagementReportTests(String.Empty, ValueRecurrenceTypeMonthly);
            ShimAudienceEngagementReport.GetListByRangeInt32Int32StringStringDateTimeDateTime =
                (x1, x2, x, x3, x4, x5) => new List <AudienceEngagementReport>();
            _testedClass.SetStaticFieldOrProperty(FieldMasterStartDate, new DateTime(2018, 2, 2));
            var message         = new EmailDirect();
            var constructedBody = String.Empty;
            var report          = new TestAudienceEngagementReport(message, constructedBody, _reportSchedule, DateTime.Today);

            // Act
            var returnResult = report.Execute();

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(NoRecordStringGetAudienceEngagementReport);
        }
예제 #3
0
        public void GetAudienceEngagementReport_FileTypeDefault_RecurrenceDefault_NoReportParameterException()
        {
            // Arrange
            InitilizeGetAudienceEngagementReportTests(String.Empty, String.Empty);
            _reportSchedule = new ECN_Framework_Entities.Communicator.Fakes.ShimReportSchedule
            {
                RecurrenceTypeGet = () => throw new Exception(ExceptionNoReportScheduleParameters)
            };
            var message         = new EmailDirect();
            var constructedBody = String.Empty;
            var report          = new TestAudienceEngagementReport(message, constructedBody, _reportSchedule, DateTime.Today);

            // Act
            var returnResult = report.Execute();

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(FailureMessageForGetGetAudienceEngagementReport);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionNoReportScheduleParameters);
        }