예제 #1
0
        public void FindModuleInitializerReturnsCorrectInstance()
        {
            CompositionContainer mockContainer = new TestableRootCompositionContainer();
            ModuleLoaderService  loader        = new ModuleLoaderService();

            loader.Load(mockContainer,
                        new ModuleInfo("TestModuleName", generatedAssemblies["TestModule"].FullName, "~/TestModule"));

            IModuleInitializer initializer = loader.FindInitializer("TestModuleName");

            Assert.IsNotNull(initializer);
            Assert.AreEqual("TestModule.TestModuleInitializer", initializer.GetType().FullName);
        }
예제 #2
0
        protected void AddModuleInitializer(IModuleInitializer module)
        {
            if (module == null)
            {
                return;
            }

            if (_moduleList.Any(item => item.GetType() == module.GetType()))
            {
                return;
            }

            _moduleList.Add(module);
        }