public void ClassInitialize() { typeof(MemoryCacheConfigurationSection).Equals((null)); // Force load typeof(MdmDataManagementService).Equals(null); // Trick - Force test context to load TestApplicationContext.TestAssembly = typeof(MdmAssociationTest).Assembly; TestApplicationContext.Initialize(TestContext.CurrentContext.TestDirectory); ApplicationServiceContext.Current.AddBusinessRule(typeof(BundleBusinessRule)); ApplicationServiceContext.Current.AddBusinessRule(typeof(NationalHealthIdRule)); this.m_patientRepository = ApplicationServiceContext.Current.GetService <IRepositoryService <Patient> >(); this.m_personRepository = ApplicationServiceContext.Current.GetService <IRepositoryService <Person> >(); this.m_patientMerge = ApplicationServiceContext.Current.GetService <IRecordMergingService <Patient> >(); this.m_entityRepository = ApplicationServiceContext.Current.GetService <IRepositoryService <Entity> >(); }
/// <summary> /// Create a match job /// </summary> public MdmMatchJob(IRecordMergingService <T> recordMergingService, IJobManagerService jobManager, IJobStateManagerService stateManagerService) { this.m_id = new Guid(MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(typeof(T).Name))); this.m_mergeService = recordMergingService; this.m_stateManager = stateManagerService; // Progress change handler if (this.m_mergeService is IReportProgressChanged rpt) { rpt.ProgressChanged += (o, p) => { this.m_stateManager.SetProgress(this, p.State.ToString(), p.Progress); }; } }
/// <summary> /// DI constructor /// </summary> public AdtMessageHandler(ILocalizationService localizationService, IRecordMergingService <Patient> mergeService, IRepositoryService <Bundle> bundleService) : base(localizationService) { this.m_mergeService = mergeService; this.m_bundleService = bundleService; }