public void Init() { this.model = ClassPropertyInitializator.SetProperties<OLEOPIFinancialSupportBlock>(new OLEOPIFinancialSupportBlock()); this.model.IncomeInfo = OLEOPISupportTypes.JobEmployment; this.model.IsCurrentlyStudying = false; this.model.IsCurrentlyWorking = false; var locManager = new Mock<ILocalizationManager>(); locManager.Setup( s => s.GetValidatorTranslationTEST(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Returns("Some test string"); this.validator = new OLEOPIFinancialSupportBlockValidator(locManager.Object); }
/// <summary> /// Maps from web to db Model /// </summary> /// <param name="input">OLEOPIFinancialSupportBlock Web model</param> /// <param name="dbModel">OLEOPIFinancialInformationPage object model</param> private static void ToFinancialStudySupportDbModel(OLEOPIFinancialSupportBlock input, db.OLEOPIFinancialInformationPage dbModel) { if (input == null || dbModel == null) { throw new ArgumentException("One of model is null"); } dbModel.FinancialIncomeInfo = input.IncomeInfo.ToDbModel(); dbModel.FinancialIsCurrentlyStudying = input.IsCurrentlyStudying; dbModel.FinancialIsCurrentlyWorking = input.IsCurrentlyWorking; dbModel.FinancialOtherIncome = input.OtherIncome; dbModel.FinancialStudyWorkplaceName = input.StudyWorkplaceName; }