Пример #1
0
        public void NoCollectionTypesReturnsEmptyList()
        {
            // Arrange
            var ReportServiceContextMock = new Mock <IReportServiceContext>();

            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeNCS).Returns(string.Empty);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeApp).Returns(string.Empty);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeESF).Returns(string.Empty);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeDC).Returns(string.Empty);

            var periodSummaryReport = new PeriodSummaryReport(null, null, GetCollectionTypeFormatters(), null, null);

            // Act
            var result = periodSummaryReport.GetCollectionTypes(ReportServiceContextMock.Object);

            // Assert
            result.Should().NotBeNull();
            result.Should().BeEmpty();
        }
Пример #2
0
        public void OneCollectionSetReturnsOneFormatter(string ncs, string app, string esf, string dc, string collectionType, string collectionReturn, string fileName)
        {
            // Arrange
            var ReportServiceContextMock = new Mock <IReportServiceContext>();

            ReportServiceContextMock.Setup(rsc => rsc.CollectionYear).Returns(2021);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeNCS).Returns(ncs);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeApp).Returns(app);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeESF).Returns(esf);
            ReportServiceContextMock.Setup(rsc => rsc.CollectionReturnCodeDC).Returns(dc);

            var periodSummaryReport = new PeriodSummaryReport(null, null, GetCollectionTypeFormatters(), null, null);

            // Act
            var result = periodSummaryReport.GetCollectionTypes(ReportServiceContextMock.Object);

            // Assert
            result.Should().NotBeNull();
            result.Should().HaveCount(1);
            result.Single().CollectionType.Should().Be(collectionType);
            result.Single().CollectionReturn.Should().Be(collectionReturn);
            result.Single().FileName.Should().Be(fileName);
        }