Ejemplo n.º 1
0
        public void YearString()
        {
            var collectionDetails = new MessageHeaderCollectionDetails()
            {
                Year = MessageHeaderCollectionDetailsYear.Item2021
            };

            collectionDetails.YearString.Should().Be("2021");
        }
Ejemplo n.º 2
0
        public void CollectionString()
        {
            var collectionDetails = new MessageHeaderCollectionDetails()
            {
                Collection = MessageHeaderCollectionDetailsCollection.ILR
            };

            collectionDetails.CollectionString.Should().Be("ILR");
        }
Ejemplo n.º 3
0
        public void Map_CollectionDetails()
        {
            var input  = new Loose.MessageHeaderCollectionDetails();
            var output = new MessageHeaderCollectionDetails();

            var propertyMapper = NewMockedModelMapper(input, output);

            var mapper = NewMapper(propertyMapper);

            TestMapperEntityProperty(mapper, m => m.CollectionDetails, input, m => m.CollectionDetails, output);
        }
        public void HeaderCollectionDetailsUplifter_CleanRunShouldIncrementDates()
        {
            // Arrange
            var ruleProvider            = new RuleProvider();
            var yearUpdateConfiguration = new Mock <IYearUpdateConfiguration>();

            yearUpdateConfiguration.Setup(s => s.ShouldUpdateDate(It.IsAny <string>(), It.IsAny <string>())).Returns(true);

            var headerCollectionDetailsUplifter = new HeaderCollectionDetailsUplifter(ruleProvider, yearUpdateConfiguration.Object);

            var messageHeaderCollectionDetails = new MessageHeaderCollectionDetails
            {
                FilePreparationDate = new DateTime(2019, 06, 07)
            };

            // Act
            var result = headerCollectionDetailsUplifter.Process(messageHeaderCollectionDetails);

            // Assert
            yearUpdateConfiguration.Verify(v => v.ShouldUpdateDate("MessageHeaderCollectionDetails", "FilePreparationDate"), Times.Once);
            result.Should().NotBeNull();
            result.FilePreparationDate.Should().Be(new DateTime(2020, 06, 07));
        }