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


C# Graph.AddPackageDefinition方法代码示例

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


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

示例1: Graph

 public void SortTopologicallyAsString_returns_dependency_package_before_the_package_itself_regardless_of_addition_order_to_graph()
 {
     Graph graph = new Graph();
     PackageDefinition definitionB = new PackageDefinition("B");
     PackageDefinition definitionA = new PackageDefinition("A:B");
     graph.AddPackageDefinition(definitionB);
     graph.AddPackageDefinition(definitionA);
     string sortedList = graph.SortTopologicallyAsString();
     Assert.AreEqual("B, A", sortedList);
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:10,代码来源:GraphTests.cs

示例2: AddNode_adds_node_into_list

 public void AddNode_adds_node_into_list()
 {
     Graph graph = new Graph();
     PackageDefinition definition = new PackageDefinition("A");
     graph.AddPackageDefinition(definition);
     Assert.IsTrue(graph.Contains(definition.Package));
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:7,代码来源:GraphTests.cs

示例3: SortTopologicallyAsString_does_not_scan_dependencies_for_Visited_packages

 public void SortTopologicallyAsString_does_not_scan_dependencies_for_Visited_packages()
 {
     Graph graph = new Graph();
     PackageDefinition definitionA = new PackageDefinition("A:B");
     definitionA.MarkAsAdded();
     graph.AddPackageDefinition(definitionA);
     Queue<string> result = graph.SortTopologically();
     Assert.IsEmpty(result);
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:9,代码来源:GraphTests.cs

示例4: SortTopologicallyAsString_throws_exception_if_package_definitions_contain_cycle

 public void SortTopologicallyAsString_throws_exception_if_package_definitions_contain_cycle()
 {
     Graph graph = new Graph();
     PackageDefinition definitionA = new PackageDefinition("A:B");
     PackageDefinition definitionB = new PackageDefinition("B:A");
     graph.AddPackageDefinition(definitionA);
     graph.AddPackageDefinition(definitionB);
     Assert.Throws<InvalidOperationException>(() => graph.SortTopologically());
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:9,代码来源:GraphTests.cs

示例5: SortTopologicallyAsString_returns_the_node_if_it_has_no_dependency_list

 public void SortTopologicallyAsString_returns_the_node_if_it_has_no_dependency_list()
 {
     Graph graph = new Graph();
     PackageDefinition definition = new PackageDefinition("A");
     graph.AddPackageDefinition(definition);
     string sortedList = graph.SortTopologicallyAsString();
     Assert.AreEqual("A", sortedList);
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:8,代码来源:GraphTests.cs

示例6: SortTopologically_returns_the_node_if_it_has_no_dependency_list

 public void SortTopologically_returns_the_node_if_it_has_no_dependency_list()
 {
     Graph graph = new Graph();
     PackageDefinition definition = new PackageDefinition("A");
     graph.AddPackageDefinition(definition);
     Queue<string> sortedQueue = graph.SortTopologically();
     Assert.IsTrue(sortedQueue.Count == 1);
     Assert.AreEqual(definition.Package, sortedQueue.Peek());
 }
开发者ID:hmonzer,项目名称:PackageInstaller,代码行数:9,代码来源:GraphTests.cs


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