Esempio n. 1
0
        public void GetGroupExport_FileFormatDefault_InvalidGroupId()
        {
            // Arrange
            InitilizeGetGroupExportTests(String.Empty, String.Empty, String.Empty, ValueText0);
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(FailureMessageFoExportGroup);
        }
Esempio n. 2
0
        public void GetGroupExport_FileFormatXls_ExportSettingAllUdfs_NoException()
        {
            // Arrange
            InitilizeGetGroupExportTests(FileFormatXls, String.Empty, ExportSettingAllUdfs);
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldContain(SuccessfulResultStringGetGroupExport);
            _anyException.ShouldBeFalse();
        }
Esempio n. 3
0
        public void GetGroupExport_FileFormatTxt_AllSubscribeTypeCode_NoException()
        {
            // Arrange
            InitilizeGetGroupExportTests(FileFormatTxt, ValueTextCharStar, String.Empty);
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeTrue();
            report.Body.ShouldContain(SuccessfulResultStringGetGroupExport);
            _anyException.ShouldBeFalse();
        }
Esempio n. 4
0
        public void GetGroupExport_FileFormatDefault_NoData()
        {
            // Arrange
            InitilizeGetGroupExportTests(String.Empty, String.Empty, String.Empty);
            ECN_Framework_BusinessLayer.Communicator.Fakes.ShimEmailGroup.
            GetGroupEmailProfilesWithUDFInt32Int32StringStringString =
                (x1, x2, x3, x4, x5) => new DataTable();
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(NoRecordStringGetGroupExport);
        }
Esempio n. 5
0
        public void GetGroupExport_FileFormatDefault_NoReportParameterException()
        {
            // Arrange
            InitilizeGetGroupExportTests(String.Empty, String.Empty, String.Empty);
            _reportSchedule = new ECN_Framework_Entities.Communicator.Fakes.ShimReportSchedule
            {
                ReportParametersGet = () => throw new Exception(ExceptionNoReportScheduleParameters)
            };
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(FailureMessageFoExportGroup);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionNoReportScheduleParameters);
        }
Esempio n. 6
0
        public void GetGroupExport_FileFormatDefault_FTPException()
        {
            // Arrange
            InitilizeGetGroupExportTests(String.Empty, String.Empty, String.Empty);
            ShimWebRequest.CreateString = (p) =>
            {
                throw new Exception(ExceptionMessageFTP);
            };
            var constructedBody = String.Empty;
            var report          = new TestGroupExportReport(null, constructedBody, _reportSchedule, DateTime.Today);

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

            // Assert
            returnResult.success.ShouldBeFalse();
            report.Body.ShouldContain(FailureMessageFoExportGroup);
            _anyException.ShouldBeTrue();
            _exceptionMessage.ShouldBe(ExceptionMessageFTP);
        }