Пример #1
0
        public void GetUnsubscribeReasonReport_RecurrenceTypeMonthly_XMLFileType_NoException()
        {
            // Arrange
            InitilizeGetUnsubscribeReasonReport(FileTypeXml, ValueRecurrenceTypeMonthly, ValueInt1, ValueInt1, ValueInt1);
            ShimFileStream.ConstructorStringFileMode = (x1, x2, x3) => { new ShimFileStream(); };
            ShimReportViewerExport.ToDataTableOf1IListOfM0 <UnsubscribeReasonDetail>((p) =>
            {
                return(new ShimDataTable
                {
                    WriteXmlStreamBoolean = (x1, x2) => { }
                });
            });
            var constructedBody = String.Empty;

            var methodArguments = new object[] { null, constructedBody, _reportSchedule };

            // Act
            var returnResult = (ReturnReport)_testedClass.InvokeStatic(
                MethodGetUnsubscribeReasonReport, methodArguments);

            constructedBody = (string)methodArguments[1];

            // Assert
            returnResult.ShouldNotBeNull();
            returnResult.success.ShouldBeTrue();
            constructedBody.ShouldBe(SuccessfulResultStringGetUnsubscribeReasonReport);
            _anyException.ShouldBeFalse();
        }
        public void DownloadBouncedEmails_Success_BouncedEmailsAreDownloaded(string blastId, string downloadType)
        {
            // Arrange
            CreateShims();
            _queryString.Add("BlastID", blastId);
            var bouncedEmailsDownloaded = false;

            ShimReportViewerExport.ExportToExcelFromDataTblOf1ListOfM0StringStringString <DataRow>((a, b, c, d) => new List <DataRow>());
            ShimBlastActivity.DownloadBlastReportDetailsInt32BooleanStringStringStringUserStringStringStringBoolean = (a, b, c, d, e, f, g, h, i, j) =>
            {
                bouncedEmailsDownloaded = true;
                return(new DataTable());
            };

            // Act
            _privateTestObject.Invoke(MethodDownloadBouncedEmails, DummyString, downloadType);

            // Assert
            bouncedEmailsDownloaded.ShouldBeTrue();
        }
        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();
        }