Beispiel #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 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();
        }