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."); }
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."); }
public void LooseModuleIfDependentOnModuleInGroupThrows() { var catalog = new ModuleCatalog(); catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleA") }); catalog.AddModule(CreateModuleInfo("ModuleB", "ModuleA")); try { catalog.Validate(); } catch (Exception ex) { Assert.IsType <ModularityException>(ex); Assert.Equal("ModuleB", ((ModularityException)ex).ModuleName); return; } //Assert.Fail("Exception not thrown."); }
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."); }
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."); }