CallCreateContainer() public méthode

public CallCreateContainer ( ) : System.Composition.Hosting.CompositionHost
Résultat System.Composition.Hosting.CompositionHost
Exemple #1
0
        public void CreateContainerShouldNotInitializeContainerProviders()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.CallCreateContainer();

            Assert.AreEqual(0, bootstrapper.BaseContainer.Providers.Count);
        }
        public void CreateContainerShouldNotInitializeContainerProviders()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.CallCreateContainer();

            Assert.AreEqual(0, bootstrapper.BaseContainer.Providers.Count);
        }
        public void CreateContainerShouldInitializeContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.CallCreateContainer();

            Assert.IsNotNull(bootstrapper.BaseContainer);
            Assert.IsInstanceOfType(bootstrapper.BaseContainer, typeof(CompositionContainer));
        }
Exemple #4
0
        public void CreateContainerShouldInitializeContainer()
        {
            var bootstrapper = new DefaultMefBootstrapper();

            bootstrapper.CallCreateContainer();

            Assert.IsNotNull(bootstrapper.BaseContainer);
            Assert.IsInstanceOfType(bootstrapper.BaseContainer, typeof(CompositionContainer));
        }
Exemple #5
0
        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());
        }
Exemple #6
0
        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());
        }
Exemple #7
0
        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 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 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());
        }