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); }
protected void AddModuleInitializer(IModuleInitializer module) { if (module == null) { return; } if (_moduleList.Any(item => item.GetType() == module.GetType())) { return; } _moduleList.Add(module); }