public void ConfigureContainerAddsAggregateCatalogToContainer() { var bootstrapper = new DefaultMefBootstrapper(); bootstrapper.CallCreateLogger(); bootstrapper.CallCreateAggregateCatalog(); bootstrapper.CallCreateModuleCatalog(); bootstrapper.CallCreateContainer(); bootstrapper.CallConfigureContainer(); var returnedCatalog = bootstrapper.BaseContainer.GetExportedValue <AggregateCatalog>(); Assert.IsNotNull(returnedCatalog); Assert.AreEqual(typeof(AggregateCatalog), returnedCatalog.GetType()); }
public void ConfigureContainerAddsMefServiceLocatorAdapterToContainer() { var bootstrapper = new DefaultMefBootstrapper(); bootstrapper.CallCreateLogger(); bootstrapper.CallCreateAggregateCatalog(); bootstrapper.CallCreateModuleCatalog(); bootstrapper.CallCreateContainer(); bootstrapper.CallConfigureContainer(); var returnedServiceLocatorAdapter = bootstrapper.BaseContainer.GetExportedValue <IServiceLocator>(); Assert.IsNotNull(returnedServiceLocatorAdapter); Assert.AreEqual(typeof(MefServiceLocatorAdapter), returnedServiceLocatorAdapter.GetType()); }
public void ConfigureContainerAddsLoggerFacadeToContainer() { var bootstrapper = new DefaultMefBootstrapper(); bootstrapper.CallCreateLogger(); bootstrapper.CallCreateAggregateCatalog(); bootstrapper.CallCreateModuleCatalog(); bootstrapper.CallCreateContainer(); bootstrapper.CallConfigureContainer(); var returnedCatalog = bootstrapper.BaseContainer.GetExportedValue <ILoggerFacade>(); Assert.IsNotNull(returnedCatalog); Assert.IsTrue(returnedCatalog is ILoggerFacade); }
public void RunShouldCallTheMethodsInOrder() { var bootstrapper = new DefaultMefBootstrapper { ShellObject = new UserControl() }; bootstrapper.Run(); Assert.AreEqual("CreateLogger", bootstrapper.MethodCalls[0]); Assert.AreEqual("CreateModuleCatalog", bootstrapper.MethodCalls[1]); Assert.AreEqual("ConfigureModuleCatalog", bootstrapper.MethodCalls[2]); Assert.AreEqual("CreateAggregateCatalog", bootstrapper.MethodCalls[3]); Assert.AreEqual("ConfigureAggregateCatalog", bootstrapper.MethodCalls[4]); Assert.AreEqual("CreateContainer", bootstrapper.MethodCalls[5]); Assert.AreEqual("ConfigureContainer", bootstrapper.MethodCalls[6]); Assert.AreEqual("ConfigureServiceLocator", bootstrapper.MethodCalls[7]); Assert.AreEqual("ConfigureRegionAdapterMappings", bootstrapper.MethodCalls[8]); Assert.AreEqual("ConfigureDefaultRegionBehaviors", bootstrapper.MethodCalls[9]); Assert.AreEqual("RegisterFrameworkExceptionTypes", bootstrapper.MethodCalls[10]); Assert.AreEqual("CreateShell", bootstrapper.MethodCalls[11]); Assert.AreEqual("InitializeShell", bootstrapper.MethodCalls[12]); Assert.AreEqual("InitializeModules", bootstrapper.MethodCalls[13]); }
public void CanRunBootstrapper() { var bootstrapper = new DefaultMefBootstrapper(); bootstrapper.Run(); }
public void AggregateCatalogDefaultsToNull() { var bootstrapper = new DefaultMefBootstrapper(); Assert.IsNull(bootstrapper.BaseAggregateCatalog); }