public void GetDataDumpReport_RecurrenceTypeDefault_CsvFileType_NoException()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(FileTypeCsv, String.Empty);
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldBe(SuccessfulResultString);
            _anyException.ShouldBeFalse();
        }
        public void GetDataDumpReport_RecurrenceTypeMonthly_DafaultFileType_NoData()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(String.Empty, ValueRecurrenceTypeMonthly);
            ShimDataDumpReport.GetListInt32DateTimeDateTimeString = (x1, x2, x3, x4) => new List <DataDumpReport>();
            _testedClass.SetStaticFieldOrProperty(FieldMasterStartDate, new DateTime(2018, 2, 2));
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldBe(NoDataResultString);
        }
        public void GetDataDumpReport_RecurrenceTypeDaily_XlsFileType_NoException()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(FileTypeXls, ValueRecurrenceTypeDaily);
            SettingsForFileTypePdfXls();
            ShimBlastFieldsName.GetByBlastFieldIDInt32User = (x1, x2) => null;
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldBe(SuccessfulResultString);
            _anyException.ShouldBeFalse();
        }
        public void GetDataDumpReport_RecurrenceTypeDefault_DafaultFileType_NoReportParameterException()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(String.Empty, String.Empty);
            _reportSchedule = new ECN_Framework_Entities.Communicator.Fakes.ShimReportSchedule
            {
                ReportParametersGet = () => throw new Exception(ExceptionNoReportScheduleParameters)
            };
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldBe(FailureResultString);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionNoReportScheduleParameters);
        }
        public void GetDataDumpReport_RecurrenceTypeDefault_DafaultFileType_FTPException()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(String.Empty, String.Empty);
            ShimWebRequest.CreateString = (p) =>
            {
                throw new Exception(ExceptionMessageFTP);
            };
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldBe(FailureResultString);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionMessageFTP);
        }
        public void GetDataDumpReport_RecurrenceTypeMonthly_XMLFileType_NoException()
        {
            // Arrange
            InitilizeGetDataDumpReportTests(FileTypeXml, ValueRecurrenceTypeMonthly, ValueInt1, ValueInt1, ValueInt1);
            ShimFileStream.ConstructorStringFileMode = (x1, x2, x3) => { new ShimFileStream(); };
            ShimReportViewerExport.ToDataTableOf1IListOfM0 <DataDumpReport>((p) =>
            {
                return(new ShimDataTable
                {
                    WriteXmlStreamBoolean = (x1, x2) => { }
                });
            });
            var constructedBody = String.Empty;
            var report          = new TestDataDumpReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldBe(SuccessfulResultString);
            _anyException.ShouldBeFalse();
        }