当前位置: 首页>>代码示例>>C#>>正文


C# ModuleCatalog.CompleteListWithDependencies方法代码示例

本文整理汇总了C#中ModuleCatalog.CompleteListWithDependencies方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleCatalog.CompleteListWithDependencies方法的具体用法?C# ModuleCatalog.CompleteListWithDependencies怎么用?C# ModuleCatalog.CompleteListWithDependencies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModuleCatalog的用法示例。


在下文中一共展示了ModuleCatalog.CompleteListWithDependencies方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanCompleteListWithTheirDependencies

        public void CanCompleteListWithTheirDependencies()
        {
            // A <- B <- C
            var moduleInfoA = CreateModuleInfo("A");
            var moduleInfoB = CreateModuleInfo("B", "A");
            var moduleInfoC = CreateModuleInfo("C", "B");
            var moduleInfoOrphan = CreateModuleInfo("X", "B");

            List<ModuleInfo> moduleInfos = new List<ModuleInfo>
                                               {
                                                   moduleInfoA
                                                   , moduleInfoB
                                                   , moduleInfoC
                                                   , moduleInfoOrphan
                                               };
            var moduleCatalog = new ModuleCatalog(moduleInfos);

            IEnumerable<ModuleInfo> dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleInfoC });

            Assert.AreEqual(3, dependantModules.Count());
            Assert.IsTrue(dependantModules.Contains(moduleInfoA));
            Assert.IsTrue(dependantModules.Contains(moduleInfoB));
            Assert.IsTrue(dependantModules.Contains(moduleInfoC));
        }
开发者ID:CarlosVV,项目名称:mediavf,代码行数:24,代码来源:ModuleCatalogFixture.cs

示例2: CompleteListWithDependenciesThrowsWithNull

 public void CompleteListWithDependenciesThrowsWithNull()
 {
     var catalog = new ModuleCatalog();
     catalog.CompleteListWithDependencies(null);
 }
开发者ID:CarlosVV,项目名称:mediavf,代码行数:5,代码来源:ModuleCatalogFixture.cs

示例3: ShouldReturnInCorrectRetrieveOrderWhenCompletingListWithDependencies

        public void ShouldReturnInCorrectRetrieveOrderWhenCompletingListWithDependencies()
        {
            // A <- B <- C <- D,    C <- X
            var moduleA = CreateModuleInfo("A");
            var moduleB = CreateModuleInfo("B", "A");
            var moduleC = CreateModuleInfo("C", "B");
            var moduleD = CreateModuleInfo("D", "C");
            var moduleX = CreateModuleInfo("X", "C");

            var moduleCatalog = new ModuleCatalog();
            // Add the modules in random order
            moduleCatalog.AddModule(moduleB);
            moduleCatalog.AddModule(moduleA);
            moduleCatalog.AddModule(moduleD);
            moduleCatalog.AddModule(moduleX);
            moduleCatalog.AddModule(moduleC);

            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleD, moduleX }).ToList();

            Assert.AreEqual(5, dependantModules.Count);
            Assert.IsTrue(dependantModules.IndexOf(moduleA) < dependantModules.IndexOf(moduleB));
            Assert.IsTrue(dependantModules.IndexOf(moduleB) < dependantModules.IndexOf(moduleC));
            Assert.IsTrue(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleD));
            Assert.IsTrue(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleX));
        }
开发者ID:CarlosVV,项目名称:mediavf,代码行数:25,代码来源:ModuleCatalogFixture.cs

示例4: CompleteListWithDependenciesThrowsWithNull

 public void CompleteListWithDependenciesThrowsWithNull()
 {
     var catalog = new ModuleCatalog();
     Assert.ThrowsException<ArgumentNullException>(() => catalog.CompleteListWithDependencies(null));
 }
开发者ID:ZeroInfinite,项目名称:PortablePrism,代码行数:5,代码来源:ModuleCatalogFixture.cs


注:本文中的ModuleCatalog.CompleteListWithDependencies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。