Пример #1
0
        public void GetAdvertiserClickReport_FileTypeDefault_RecurrenceDefault_NoReportParameterException()
        {
            // Arrange
            InitilizeGetAdvertiserClickReportTests(String.Empty, String.Empty);
            _reportSchedule = new ECN_Framework_Entities.Communicator.Fakes.ShimReportSchedule
            {
                CreatedUserIDGet = () => throw new Exception(ExceptionNoReportScheduleParameters)
            };

            var message         = new EmailDirect();
            var constructedBody = String.Empty;
            var report          = new EntityAdvertiserClickReport(
                message,
                constructedBody,
                _reportSchedule,
                DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(FailureMessageForGetAdvertiserClickReport);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionNoReportScheduleParameters);
        }
Пример #2
0
        public void GetAdvertiserClickReport_FileTypeCsv_RecurrenceDaily_NoException()
        {
            // Arrange
            InitilizeGetAdvertiserClickReportTests(FileTypeCsv, ValueRecurrenceTypeDaily);
            var message         = new EmailDirect();
            var constructedBody = string.Empty;
            var report          = new EntityAdvertiserClickReport(
                message,
                constructedBody,
                _reportSchedule,
                DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldContain(SuccessfulResultStringGetAdvertiserClickReport);
            _anyException.ShouldBeFalse();
        }
Пример #3
0
        public void GetAdvertiserClickReport_FileTypeDefault_RecurrenceTypeMonthly_NoData()
        {
            // Arrange
            InitilizeGetAdvertiserClickReportTests(String.Empty, ValueRecurrenceTypeMonthly);
            ShimAdvertiserClickReport.GetListInt32DateTimeDateTime =
                (x1, x2, x3) => new List <AdvertiserClickReport>();
            _testedClass.SetStaticFieldOrProperty(FieldMasterStartDate, new DateTime(2018, 2, 2));
            var message         = new EmailDirect();
            var constructedBody = String.Empty;
            var report          = new EntityAdvertiserClickReport(
                message,
                constructedBody,
                _reportSchedule,
                DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(NoRecordStringGetAdvertiserClickReport);
        }