public void ProtectiveMarkingString() { var headerSource = new MessageHeaderSource() { ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIALSENSITIVEPersonal }; headerSource.ProtectiveMarkingString.Should().Be("OFFICIAL-SENSITIVE-Personal"); }
public void Map_Source() { var input = new Loose.MessageHeaderSource(); var output = new MessageHeaderSource(); var propertyMapper = NewMockedModelMapper(input, output); var mapper = NewMapper(sourceMapper: propertyMapper); TestMapperEntityProperty(mapper, m => m.Source, input, m => m.Source, output); }
public void ProtectiveMarkingString_Property_NotNull() { var valToTest = MessageHeaderSourceProtectiveMarking.OFFICIAL_SENSITIVE_Personal; var msgHeaderSource = new MessageHeaderSource { ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIAL_SENSITIVE_Personal }; msgHeaderSource.ProtectiveMarking.Should().Be(valToTest); }
public void HeaderSourceUplifter_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 headerSourceUplifter = new HeaderSourceUplifter(ruleProvider, yearUpdateConfiguration.Object); var messageHeaderSource = new MessageHeaderSource { DateTime = new DateTime(2019, 06, 08) }; // Act var result = headerSourceUplifter.Process(messageHeaderSource); // Assert yearUpdateConfiguration.Verify(v => v.ShouldUpdateDate("MessageHeaderSource", "DateTime"), Times.Once); result.Should().NotBeNull(); result.DateTime.Should().Be(new DateTime(2020, 06, 08)); }
public void Amalgamate_Pass2() { DateTime date1 = new DateTime(2020, 07, 26); DateTime date2 = new DateTime(2018, 07, 26); DateTime dateTimeNow = new DateTime(2020, 08, 16); var mockDateTimeProvider = new Mock <IDateTimeProvider>(); mockDateTimeProvider.Setup(d => d.GetNowUtc()).Returns(dateTimeNow); var objToCompare = new MessageHeaderSource() { DateTime = date1, UKPRN = 10000001, ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIAL_SENSITIVE_Personal, SoftwareSupplier = "ESFA", SoftwarePackage = "FileMerge", Release = "01", SerialNo = "00" }; List <MessageHeaderSource> headerSourcesList = new List <MessageHeaderSource>() { new MessageHeaderSource() { DateTime = date1, ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIAL_SENSITIVE_Personal, UKPRN = 10000001, SoftwareSupplier = "Skills Funding Agency", SoftwarePackage = "ILR Learner Entry", Release = "2021.1.0.14278", SerialNo = "01", ReferenceData = "ReferenceData", ComponentSetVersion = "ComponentSetVersion", Parent = GetParent() }, new MessageHeaderSource() { DateTime = date2, ProtectiveMarking = MessageHeaderSourceProtectiveMarking.OFFICIAL_SENSITIVE_Personal, UKPRN = 10000001, SoftwareSupplier = "Skills Funding Agency", SoftwarePackage = "ILR Learner Entry", Release = "2021.1.0.14278", SerialNo = "01", ReferenceData = "ReferenceData", ComponentSetVersion = "ComponentSetVersion", Parent = GetParent() } }; var amalgamate = NewAmalgamator(mockDateTimeProvider.Object, _amalgamationErrorHandler).Amalgamate(headerSourcesList); amalgamate.DateTime.Should().Be(dateTimeNow); amalgamate.ProtectiveMarking.Should().Be(objToCompare.ProtectiveMarking); amalgamate.UKPRN.Should().Be(objToCompare.UKPRN); amalgamate.SoftwareSupplier.Should().Be(objToCompare.SoftwareSupplier); amalgamate.SoftwarePackage.Should().Be(objToCompare.SoftwarePackage); amalgamate.Release.Should().Be(objToCompare.Release); amalgamate.SerialNo.Should().Be(objToCompare.SerialNo); amalgamate.ReferenceData.Should().Be(objToCompare.ReferenceData); amalgamate.ComponentSetVersion.Should().Be(objToCompare.ComponentSetVersion); }