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


C# DependencyGraph.HasDependees方法代码示例

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


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

示例1: NonEmptyTest3

 public void NonEmptyTest3()
 {
     DependencyGraph t = new DependencyGraph();
     t.AddDependency("a", "b");
     t.AddDependency("a", "c");
     t.AddDependency("d", "c");
     Assert.IsFalse(t.HasDependees("a"));
     Assert.IsTrue(t.HasDependees("b"));
     Assert.IsTrue(t.HasDependents("a"));
     Assert.IsTrue(t.HasDependees("c"));
 }
开发者ID:jimibue,项目名称:cs3505,代码行数:11,代码来源:DevelopmentTests.cs

示例2: EmptyTest2

 public void EmptyTest2()
 {
     DependencyGraph t = new DependencyGraph();
     Assert.IsFalse(t.HasDependees("a"));
 }
开发者ID:jimibue,项目名称:cs3505,代码行数:5,代码来源:DevelopmentTests.cs

示例3: NonEmptyTest18

 public void NonEmptyTest18()
 {
     DependencyGraph t = new DependencyGraph();
     t.AddDependency("x", "b");
     t.AddDependency("a", "z");
     t.ReplaceDependents("b", new HashSet<string>());
     t.AddDependency("y", "b");
     t.ReplaceDependents("a", new HashSet<string>() { "c" });
     t.AddDependency("w", "d");
     t.ReplaceDependees("b", new HashSet<string>() { "a", "c" });
     t.ReplaceDependees("d", new HashSet<string>() { "b" });
     Assert.IsTrue(t.HasDependents("a"));
     Assert.IsFalse(t.HasDependees("a"));
     Assert.IsTrue(t.HasDependents("b"));
     Assert.IsTrue(t.HasDependees("b"));
 }
开发者ID:Leyalic,项目名称:PS6_2015,代码行数:16,代码来源:GradingTests.cs

示例4: NonEmptyTest13

 public void NonEmptyTest13()
 {
     DependencyGraph t = new DependencyGraph();
     t.AddDependency("x", "y");
     t.AddDependency("a", "b");
     t.AddDependency("a", "c");
     t.AddDependency("a", "d");
     t.AddDependency("c", "b");
     t.RemoveDependency("a", "d");
     t.AddDependency("e", "b");
     t.AddDependency("b", "d");
     t.RemoveDependency("e", "b");
     t.RemoveDependency("x", "y");
     Assert.IsTrue(t.HasDependents("a"));
     Assert.IsFalse(t.HasDependees("a"));
     Assert.IsTrue(t.HasDependents("b"));
     Assert.IsTrue(t.HasDependees("b"));
 }
开发者ID:Leyalic,项目名称:PS6_2015,代码行数:18,代码来源:GradingTests.cs

示例5: EmptyTest8

 public void EmptyTest8()
 {
     DependencyGraph t = new DependencyGraph();
     t.AddDependency("x", "y");
     Assert.IsTrue(t.HasDependees("y"));
     Assert.IsTrue(t.HasDependents("x"));
     t.RemoveDependency("x", "y");
     Assert.IsFalse(t.HasDependees("y"));
     Assert.IsFalse(t.HasDependents("x"));
 }
开发者ID:Leyalic,项目名称:PS6_2015,代码行数:10,代码来源:GradingTests.cs

示例6: MyTest11

        public void MyTest11()
        {
            DependencyGraph t = new DependencyGraph();
            t.AddDependency("b", "b");
            t.ReplaceDependents("b", new HashSet<string>() { "c" });
            Assert.IsTrue(t.HasDependees("c"));

        }
开发者ID:Buck417,项目名称:First-Half-CS-3500,代码行数:8,代码来源:UnitTest1.cs

示例7: MyTest

        public void MyTest()
        {
            DependencyGraph t = new DependencyGraph();
            t.AddDependency("a", "b");
            t.AddDependency("a", "c");
            t.AddDependency("b", "d");
            t.AddDependency("d", "d");
            Assert.IsTrue(t.GetDependents("a").ToHashSet().SetEquals(new HashSet<string>() { "b", "c" }));
            Assert.IsTrue(t.GetDependents("b").ToHashSet().SetEquals(new HashSet<string>() { "d" }));
            Assert.IsTrue(t.GetDependents("c").ToHashSet().SetEquals(new HashSet<string>() { }));
            Assert.IsTrue(t.GetDependents("d").ToHashSet().SetEquals(new HashSet<string>() { "d" }));
            Assert.IsTrue(t.GetDependees("a").ToHashSet().SetEquals(new HashSet<string>() {  }));
            Assert.IsTrue(t.GetDependees("b").ToHashSet().SetEquals(new HashSet<string>() { "a" }));
            Assert.AreEqual(1, t["b"]);
            Assert.IsTrue(t.GetDependees("c").ToHashSet().SetEquals(new HashSet<string>() { "a" }));
            Assert.IsTrue(t.GetDependees("d").ToHashSet().SetEquals(new HashSet<string>() { "b","d" }));
            Assert.AreEqual(2, t["d"]);
            Assert.AreEqual(0, t["h"]);
            Assert.AreEqual(0, t["a"]);
            Assert.IsFalse(t.HasDependees("a"));
            Assert.IsFalse(t.HasDependees("f"));
            Assert.IsFalse(t.HasDependents("c"));
            Assert.IsTrue(t.HasDependents("a"));
            Assert.IsFalse(t.HasDependents("h"));
            Assert.IsTrue(t.HasDependents("d"));
            Assert.IsTrue(t.HasDependees("b"));
            Assert.IsTrue(t.HasDependees("c")); 
            Assert.IsTrue(t.HasDependees("d"));
            Assert.AreEqual(4, t.Size);


            
            t.RemoveDependency("a", "b");
            Assert.IsTrue(t.GetDependents("a").ToHashSet().SetEquals(new HashSet<string>() { "c" }));
            Assert.IsTrue(t.GetDependees("b").ToHashSet().SetEquals(new HashSet<string>() {  }));

            t.AddDependency("a", "b");
            t.AddDependency("a", "b");
            t.ReplaceDependents("a", new HashSet<string>() { "x", "y", "x", "y" ,"z"});
            Assert.IsTrue(t.GetDependents("a").ToHashSet().SetEquals(new HashSet<string>() { "x", "y","z"}));
            Assert.AreEqual(5, t.Size);


            t.ReplaceDependees("b", new HashSet<string>() { "x", "y", "x", "y" });
            Assert.IsTrue(t.GetDependees("b").ToHashSet().SetEquals(new HashSet<string>() { "x", "y" }));
            Assert.AreEqual(7, t.Size);
            Assert.AreEqual(2, t["b"]);
           

            //Assert.AreEqual(4, t.Size);
        }
开发者ID:jimibue,项目名称:cs3505,代码行数:51,代码来源:UnitTest1.cs


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