Exemple #1
0
        public void NonSelfScanningContainerAdapters()
        {
            ContainerAdapterAccessor.Clear();
            IContainerManager containerManager = new ContainerManager();

            Assert.IsNull(containerManager.Resolve <IDependantClass>());
        }
Exemple #2
0
        public void SelfScanningContainerAdapters()
        {
            ContainerAdapterAccessor.Clear();
            IContainerManager containerManager = new ContainerManager(TestConstants.AutofacContainerName);

            Assert.IsNotNull(containerManager.Resolve <IDependantClass>());
        }
Exemple #3
0
        public void PreRegisteredContainerAdapter()
        {
            ContainerAdapterAccessor.Clear();
            var adapter = new AutofacContainerAdapter();

            adapter.Register <IDependantClass, DependantClass2>();
            IContainerManager containerManager = new ContainerManager(adapter);

            Assert.IsNotNull(containerManager.Resolve <IDependantClass>());
            var containerManager2 = new ContainerManager();

            Assert.IsNotNull(containerManager2.Resolve <IDependantClass>());
        }