コード例 #1
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);

            IEnumerable<ModuleInfo> dependentModules = moduleCatalog.GetDependentModules(moduleInfoB);

            Assert.AreEqual(1, dependentModules.Count());
            Assert.AreEqual(moduleInfoA, dependentModules.ElementAt(0));
        }
コード例 #2
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());

        }