示例#1
0
        public LearnerLearningDeliveryUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
        {
            var modelName = typeof(MessageLearnerLearningDelivery).Name;
            Func <DateTime?, DateTime?> standardNullableDateUplifter = ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition;

            _learnStartDateProps = new FieldUpdateProperties <MessageLearnerLearningDelivery, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "LearnStartDate"),
                s => s.LearnStartDate,
                standardNullableDateUplifter);

            _origLearnStartDateProps = new FieldUpdateProperties <MessageLearnerLearningDelivery, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "OrigLearnStartDate"),
                s => s.OrigLearnStartDate,
                standardNullableDateUplifter);

            _learnPlanEndDateProps = new FieldUpdateProperties <MessageLearnerLearningDelivery, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "LearnPlanEndDate"),
                s => s.LearnPlanEndDate,
                standardNullableDateUplifter);

            _learnActEndDateProps = new FieldUpdateProperties <MessageLearnerLearningDelivery, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "LearnActEndDate"),
                s => s.LearnActEndDate,
                standardNullableDateUplifter);

            _achDateProps = new FieldUpdateProperties <MessageLearnerLearningDelivery, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "AchDate"),
                s => s.AchDate,
                standardNullableDateUplifter);
        }
 public LearnerLearnerEmploymentStatusUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
 {
     _dateEmpStatAppProps = new FieldUpdateProperties <MessageLearnerLearnerEmploymentStatus, DateTime?>(
         yearUpdateConfiguration.ShouldUpdateDate(typeof(MessageLearnerLearnerEmploymentStatus).Name, "DateEmpStatApp"),
         s => s.DateEmpStatApp,
         ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition);
 }
示例#3
0
 public HeaderCollectionDetailsUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
 {
     _filePreparationDateProps = new FieldUpdateProperties <MessageHeaderCollectionDetails, DateTime>(
         yearUpdateConfiguration.ShouldUpdateDate(typeof(MessageHeaderCollectionDetails).Name, "FilePreparationDate"),
         s => s.FilePreparationDate,
         ruleProvider.BuildStandardDateUplifter <DateTime>().Definition);
 }
示例#4
0
 public LearnerUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
 {
     _dateOfBirthProps = new FieldUpdateProperties <MessageLearner, DateTime?>(
         yearUpdateConfiguration.ShouldUpdateDate(typeof(MessageLearner).Name, "DateOfBirth"),
         s => s.DateOfBirth,
         ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition);
 }
        public void ApplyRule_RuleIsAppliedToValue()
        {
            // Arrange
            var stringValue = "TestPropertyValue";
            var modelMock   = new Mock <TestModelClass>();

            modelMock.Setup(s => s.TestProperty).Returns(stringValue);
            modelMock.SetupSet(s => s.TestProperty = It.IsAny <string>()).Verifiable();

            Func <string, string> uplifter = (x) => x.ToUpper();

            Expression <Func <TestModelClass, string> > selector = m => m.TestProperty;

            var yearUpdateConfiguration = new Mock <IYearUpdateConfiguration>();

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

            var props = new FieldUpdateProperties <TestModelClass, string>(
                yearUpdateConfiguration.Object.ShouldUpdateDate(typeof(TestModelClass).Name, "TestProperty"),
                s => s.TestProperty,
                uplifter);

            // Act
            ApplyRule(props, modelMock.Object);

            // Assert
            modelMock.VerifyGet(v => v.TestProperty, Times.Once);
            modelMock.VerifySet(v => v.TestProperty = "TestPropertyValue".ToUpper(), Times.Once);
        }
示例#6
0
 public LearnerLearningDeliveryAppFinRecordUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
 {
     _aFinDateProps = new FieldUpdateProperties <MessageLearnerLearningDeliveryAppFinRecord, DateTime?>(
         yearUpdateConfiguration.ShouldUpdateDate(typeof(MessageLearnerLearningDeliveryAppFinRecord).Name, "AFinDate"),
         s => s.AFinDate,
         ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition);
 }
示例#7
0
 public HeaderSourceUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
 {
     _dateTimeProps = new FieldUpdateProperties <MessageHeaderSource, DateTime>(
         yearUpdateConfiguration.ShouldUpdateDate(typeof(MessageHeaderSource).Name, "DateTime"),
         s => s.DateTime,
         ruleProvider.BuildStandardDateUplifter <DateTime>().Definition);
 }
        public SourceFilesSourceFileUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
        {
            var modelName = typeof(MessageSourceFilesSourceFile).Name;

            _filePreparationDateProps = new FieldUpdateProperties <MessageSourceFilesSourceFile, DateTime>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "FilePreparationDate"),
                s => s.FilePreparationDate,
                ruleProvider.BuildStandardDateUplifter <DateTime>().Definition);

            _dateTimeProps = new FieldUpdateProperties <MessageSourceFilesSourceFile, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "DateTime"),
                s => s.DateTime,
                ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition);
        }
示例#9
0
        public LearnerLearningDeliveryLearningDeliveryFAMUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
        {
            var modelName = typeof(MessageLearnerLearningDeliveryLearningDeliveryFAM).Name;
            Func <DateTime?, DateTime?> standardNullableDateUplifter = ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition;

            _learnDelFAMDateFromProps = new FieldUpdateProperties <MessageLearnerLearningDeliveryLearningDeliveryFAM, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "LearnDelFAMDateFrom"),
                s => s.LearnDelFAMDateFrom,
                standardNullableDateUplifter);

            _learnDelFAMDateToProps = new FieldUpdateProperties <MessageLearnerLearningDeliveryLearningDeliveryFAM, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "LearnDelFAMDateTo"),
                s => s.LearnDelFAMDateTo,
                standardNullableDateUplifter);
        }
        public LearnerLearningDeliveryLearningDeliveryWorkPlacementUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
        {
            var modelName = typeof(MessageLearnerLearningDeliveryLearningDeliveryWorkPlacement).Name;
            Func <DateTime?, DateTime?> standardNullableDateUplifter = ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition;

            _workPlaceStartDateProps = new FieldUpdateProperties <MessageLearnerLearningDeliveryLearningDeliveryWorkPlacement, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "WorkPlaceStartDate"),
                s => s.WorkPlaceStartDate,
                standardNullableDateUplifter);

            _workPlaceEndDateProps = new FieldUpdateProperties <MessageLearnerLearningDeliveryLearningDeliveryWorkPlacement, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "WorkPlaceEndDate"),
                s => s.WorkPlaceEndDate,
                standardNullableDateUplifter);
        }
        public LearnerDestinationandProgressionDPOutcomeUplifter(IRuleProvider ruleProvider, IYearUpdateConfiguration yearUpdateConfiguration)
        {
            var modelName = typeof(MessageLearnerDestinationandProgressionDPOutcome).Name;
            Func <DateTime?, DateTime?> standardNullableDateUplifter = ruleProvider.BuildStandardDateUplifter <DateTime?>().Definition;

            _outStartDateProps = new FieldUpdateProperties <MessageLearnerDestinationandProgressionDPOutcome, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "OutStartDate"),
                s => s.OutStartDate,
                standardNullableDateUplifter);

            _outEndDateProps = new FieldUpdateProperties <MessageLearnerDestinationandProgressionDPOutcome, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "OutEndDate"),
                s => s.OutEndDate,
                standardNullableDateUplifter);

            _outCollDateProps = new FieldUpdateProperties <MessageLearnerDestinationandProgressionDPOutcome, DateTime?>(
                yearUpdateConfiguration.ShouldUpdateDate(modelName, "OutCollDate"),
                s => s.OutCollDate,
                standardNullableDateUplifter);
        }