public void Init() { 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 OLEContactInfoBlockValidator(locManager.Object); // Init test Model this.model = ClassPropertyInitializator.SetProperties<OLEContactInfoBlock>(new OLEContactInfoBlock()); this.model.AddressInformation = new AddressInformation(); this.model.AddressInformation = ClassPropertyInitializator.SetProperties<AddressInformation>(new AddressInformation()); }
/// <summary> /// Maps from web to db Model /// </summary> /// <param name="input">OLEContactInfoBlock Web model</param> /// <param name="dbModel">OLEPersonalInformationPage object model</param> public static void ToOLEContactInfoDbModel(OLEContactInfoBlock input, db.OLEPersonalInformationPage dbModel) { if (input == null || dbModel == null) { throw new ArgumentException("One of model is null"); } dbModel.ContactEmailAddress = input.EmailAddress; dbModel.ContactFinlandEmailAddress = input.FinlandEmailAddress; dbModel.ContactFinlandTelephoneNumber = input.FinlandTelephoneNumber; dbModel.ContactTelephoneNumber = input.TelephoneNumber; input.AddressInformation.ToDbModel(OLEAddressInformationRefTypeEnum.OLEPersonalInformationContactAddress, dbModel.OleAddressInformationList); input.FinlandAddressInformation.ToDbModel(OLEAddressInformationRefTypeEnum.OLEPersonalInformationContactFinlandAddress, dbModel.OleAddressInformationList); }