private void ComposeMefContainer() { AssemblyUtilities.SetEntryAssembly(); var aggregateCatalog = new AggregateCatalog(); var thisAssemblyCatalog = new AssemblyCatalog(Assembly.GetEntryAssembly()); var simulationAssemblyCatalog = new AssemblyCatalog(typeof(TaktManager).Assembly); aggregateCatalog.Catalogs.Add(thisAssemblyCatalog); aggregateCatalog.Catalogs.Add(simulationAssemblyCatalog); _container = new CompositionContainer(aggregateCatalog); _container.ComposeExportedValue(_container); _container.ComposeExportedValue(_logger.Object); }
private void ComposeMefContainer() { AssemblyUtilities.SetEntryAssembly(); var types = new TypeCatalog( typeof(PlatformModuleActivator), typeof(PlatformModuleCreator), typeof(PlatformModuleInitializer), typeof(ModuleContainer), typeof(ModuleMock), typeof(ModuleFactoryMock), typeof(PlatformDependencyManager), typeof(ConfigurationAccessor), typeof(EventAggregator), typeof(ModuleMetricMeasurement)); var aggregateCatalog = new AggregateCatalog(types); Container = new CompositionContainer(aggregateCatalog); Container.ComposeExportedValue(Container); Container.ComposeExportedValue(Logger.Object); Container.ComposeExportedValue(SafeEventRaiser.Object); Container.ComposeExportedValue(EntityContextFactory.Object); Container.ComposeExportedValue(JobManager.Object); Container.ComposeExportedValue(PlatformEntities.Object); Container.ComposeExportedValue(new CompositeAlarmManager(Logger.Object)); Container.ComposeExportedValue(new ModuleBusManager() as IModuleBusManager); Container.ComposeParts(); EventAggregator = Container.GetExportedValue <IEventAggregator>(); ModuleRepository = Container.GetExportedValue <IPlatformModuleRepository>(); ModuleBusInitializer = Container.GetExportedValue <IPlatformModuleInitializer>(); ModuleBusManager = Container.GetExportedValue <IModuleBusManager>(); Container.SatisfyImportsOnce(ModuleBusManager); }
public static void AssemblyInitialize(TestContext testContext) { AssemblyUtilities.SetEntryAssembly(); BootstrapperUI.Bootstrap(); }