public void MustThrowDuplicateModuleExceptionIfTheModuleIsRegisteredInMoreThanOnceCatalog()
 {
     var catalog = new CompositeModuleCatalog();
     var firstCatalog = new ModuleCatalog();
     firstCatalog.AddModule(new ModuleInfo("ModuleA", typeof(ModuleA).FullName));
     catalog.Add(firstCatalog);
     var secondCatalog = new ModuleCatalog();
     secondCatalog.AddModule(new ModuleInfo("ModuleA", typeof(ModuleA).FullName));
     catalog.Add(secondCatalog);
     ExceptionTester.CallMethodAndExpectException<DuplicateModuleException>(() => catalog.Initialize());
 }
            public void CallsTheInitializedMethodOfAllRegisteredCatalogs()
            {
                var catalog = new CompositeModuleCatalog();

                var firstCatalog = new FooModuleCatalog();
                firstCatalog.AddModule(new ModuleInfo("ModuleA", typeof(ModuleA).FullName));
                catalog.Add(firstCatalog);

                var secondCatalog = new FooModuleCatalog();
                secondCatalog.AddModule(new ModuleInfo("ModuleB", typeof(ModuleB).FullName));
                catalog.Add(secondCatalog);
                catalog.Initialize();

                Assert.IsTrue(firstCatalog.Initialized);
                Assert.IsTrue(secondCatalog.Initialized);
            }
 public void MustThrowArgumentNullExceptionIfIsCalledWithNullArgument()
 {
     var catalog = new CompositeModuleCatalog();
     ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => catalog.Add(null));
 }