Beispiel #1
0
        public void StartupModuleDependentOnAnOnDemandModuleThrows()
        {
            var catalog = new ModuleCatalog();
            var moduleOnDemand = CreateModuleInfo("ModuleA");
            moduleOnDemand.InitializationMode = InitializationMode.OnDemand;
            catalog.AddModule(moduleOnDemand);
            catalog.AddModule(CreateModuleInfo("ModuleB", "ModuleA"));

            try
            {
                catalog.Validate();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ModularityException));
                Assert.AreEqual("ModuleB", ((ModularityException)ex).ModuleName);

                return;
            }

            Assert.Fail("Exception not thrown.");
        }
Beispiel #2
0
        public void ModuleInGroupDependsOnModuleInOtherGroupThrows()
        {
            var catalog = new ModuleCatalog();
            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleA") });
            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleB", "ModuleA") });

            try
            {
                catalog.Validate();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ModularityException));
                Assert.AreEqual("ModuleB", ((ModularityException)ex).ModuleName);

                return;
            }

            Assert.Fail("Exception not thrown.");
        }