public void Resolve() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var config = new SourceSystemConfiguration(container); config.Configure(); var validator = container.Resolve<IMapper<EnergyTrading.Mdm.Contracts.SourceSystem, SourceSystem>>(); // Assert Assert.IsNotNull(validator, "Mapper resolution failed"); }
public void Resolve() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var config = new CurveConfiguration(container); config.Configure(); var validator = container.Resolve<IMapper<MDM.Contracts.Curve, Curve>>(); // Assert Assert.IsNotNull(validator, "Mapper resolution failed"); }
public void Resolve() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var config = new PersonConfiguration(container); config.Configure(); var validator = container.Resolve<IMapper<EnergyTrading.MDM.Contracts.Sample.Person, Person>>(); // Assert Assert.IsNotNull(validator, "Mapper resolution failed"); }
protected override void OnSetup() { // Pre-requisites for the entity configuration var mapping = new SimpleMappingEngineConfiguration(this.Container); mapping.Configure(); var repository = new Mock <IRepository>(); this.Container.RegisterInstance(repository.Object); // Register the entities stuff var config = this.CreateConfiguration(this.Container); config.Configure(); }
public void Resolve() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var config = new PartyConfiguration(container); config.Configure(); var validator = container.Resolve <IMapper <EnergyTrading.MDM.Contracts.Sample.Party, Party> >(); // Assert Assert.IsNotNull(validator, "Mapper resolution failed"); }
public void Resolve() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var config = new CurveConfiguration(container); config.Configure(); var validator = container.Resolve <IMapper <MDM.Contracts.Curve, Curve> >(); // Assert Assert.IsNotNull(validator, "Mapper resolution failed"); }
public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); container.RegisterInstance <IRepository>(new Mock <IRepository>().Object); var config = new PersonConfiguration(container); config.Configure(); var validator = container.Resolve <IValidator <EnergyTrading.MDM.Contracts.Sample.Person> >("person"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); }
public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); container.RegisterInstance <IRepository>(new Mock <IRepository>().Object); var config = new PartyConfiguration(container); config.Configure(); var validator = container.Resolve <IValidator <Party> >("party"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); }
protected void ConvertToNexusId <TMapping>() where TMapping : EntityMapping, new() { var container = new UnityContainer(); // Self-register and set up service location container.RegisterInstance <IUnityContainer>(container); var locator = new UnityServiceLocator(container); Global.ServiceLocator = locator; var task = new SimpleMappingEngineConfiguration(container); task.Configure(); var start = new DateTime(2000, 12, 31); var expected = new EnergyTrading.Mdm.Contracts.MdmId { MappingId = 34, SystemName = "Test", Identifier = "1", SourceSystemOriginated = true, StartDate = start, EndDate = DateUtility.MaxDate }; var s1 = new SourceSystem { Name = "Test" }; var m1 = new TMapping { Id = 34, System = s1, MappingValue = "1", IsMaster = true, Validity = new DateRange(start, DateUtility.MaxDate) }; var mappingEngine = container.Resolve <IMappingEngine>(); var candidate = mappingEngine.Map <IEntityMapping, EnergyTrading.Mdm.Contracts.MdmId>(m1); Check(expected, candidate); }
public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var repository = new Mock <IRepository>(); container.RegisterInstance(repository.Object); var config = new SourceSystemConfiguration(container); config.Configure(); var validator = container.Resolve <IValidator <SourceSystem> >("sourcesystem"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); }
public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); var repository = new Mock<IRepository>(); container.RegisterInstance(repository.Object); var config = new SourceSystemConfiguration(container); config.Configure(); var validator = container.Resolve<IValidator<SourceSystem>>("sourcesystem"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); }
public void ValidatorResolution() { var container = CreateContainer(); var meConfig = new SimpleMappingEngineConfiguration(container); meConfig.Configure(); container.RegisterInstance<IRepository>(new Mock<IRepository>().Object); var config = new PersonConfiguration(container); config.Configure(); var validator = container.Resolve<IValidator<EnergyTrading.MDM.Contracts.Sample.Person>>("person"); // Assert Assert.IsNotNull(validator, "Validator resolution failed"); }