public void CanGetDependenciesForModule() { // A <- B var moduleInfoA = CreateModuleInfo("A"); var moduleInfoB = CreateModuleInfo("B", "A"); List <ModuleInfo> moduleInfos = new List <ModuleInfo> { moduleInfoA , moduleInfoB }; var moduleCatalog = new ModuleCatalog(moduleInfos); IEnumerable <ModuleInfo> dependentModules = moduleCatalog.GetDependentModules(moduleInfoB); Assert.AreEqual(1, dependentModules.Count()); Assert.AreEqual(moduleInfoA, dependentModules.ElementAt(0)); }
public void ModuleInGroupCanDependOnModuleInSameGroup() { var catalog = new ModuleCatalog(); var moduleA = CreateModuleInfo("ModuleA"); var moduleB = CreateModuleInfo("ModuleB", "ModuleA"); catalog.Items.Add(new ModuleInfoGroup() { moduleA, moduleB }); var moduleBDependencies = catalog.GetDependentModules(moduleB); Assert.AreEqual(1, moduleBDependencies.Count()); Assert.AreEqual(moduleA, moduleBDependencies.First()); }
public void CanGetDependenciesForModule() { // A <- B var moduleInfoA = CreateModuleInfo("A"); var moduleInfoB = CreateModuleInfo("B", "A"); List<ModuleInfo> moduleInfos = new List<ModuleInfo> { moduleInfoA , moduleInfoB }; var moduleCatalog = new ModuleCatalog(moduleInfos); IEnumerable<ModuleInfo> dependentModules = moduleCatalog.GetDependentModules(moduleInfoB); Assert.AreEqual(1, dependentModules.Count()); Assert.AreEqual(moduleInfoA, dependentModules.ElementAt(0)); }
public void CanGetDependenciesForModule() { // A <- B var moduleInfoA = CreateModuleInfo("A"); var moduleInfoB = CreateModuleInfo("B", "A"); List <ModuleInfo> moduleInfos = new List <ModuleInfo> { moduleInfoA , moduleInfoB }; var moduleCatalog = new ModuleCatalog(moduleInfos); var dependentModules = moduleCatalog.GetDependentModules(moduleInfoB); Assert.Single(dependentModules); Assert.Equal(moduleInfoA, dependentModules.ElementAt(0)); }