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


C# BasicAdjList.GetEdge方法代码示例

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


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

示例1: GetEdge_With_Ignore_Direction_Param_Throws_When_Invalid_Type_Passed_In_For_Source_Node

 public void GetEdge_With_Ignore_Direction_Param_Throws_When_Invalid_Type_Passed_In_For_Source_Node()
 {
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = new DummyBasicNode();
     INode nodeB = net.CreateNode();
     var ex = Assert.Throws<ArgumentException>(() => net.GetEdge(nodeA, nodeB, true));
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:7,代码来源:BasicAdjListFixture.cs

示例2: GetEdge_With_Ignore_Direction_Param_Throws_When_NullPassed_In_For_Source_Node

        public void GetEdge_With_Ignore_Direction_Param_Throws_When_NullPassed_In_For_Source_Node()
        {
            //Arrange
            var net = new BasicAdjList(Guid.NewGuid());
            INode nodeA = null;
            INode nodeB = net.CreateNode();

            var ex = Assert.Throws<ArgumentNullException>(() => net.GetEdge(nodeA, nodeB, true));
        }
开发者ID:BgRva,项目名称:Blob1,代码行数:9,代码来源:BasicAdjListFixture.cs

示例3: GetEdge_With_Ignore_Direction_Param_ReturnsEdge

        public void GetEdge_With_Ignore_Direction_Param_ReturnsEdge(bool ignoreDirection)
        {
            //Arrange
            var net = new BasicAdjList(Guid.NewGuid());
            INode nodeA = net.CreateNode();
            INode nodeB = net.CreateNode();
            IEdge edge0 = net.CreateEdge(nodeA, nodeB);

            IEdge result = net.GetEdge(nodeA, nodeB, ignoreDirection);
            Assert.NotNull(result);
            Assert.Same(result, edge0);
            Assert.Same(nodeA, edge0.SourceNode);
            Assert.Same(nodeB, edge0.DestinationNode);
        }
开发者ID:BgRva,项目名称:Blob1,代码行数:14,代码来源:BasicAdjListFixture.cs

示例4: GetEdge_With_Ignore_Direction_Param_Returns_Null_If_EdgeDNE

 public void GetEdge_With_Ignore_Direction_Param_Returns_Null_If_EdgeDNE(bool ignoreDirection)
 {
     //Arrange
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = net.CreateNode();
     INode nodeB = net.CreateNode();
     INode nodeC = net.CreateNode();
     IEdge edge = net.CreateEdge(nodeA, nodeB);
     IEdge result = net.GetEdge(nodeC, nodeA, ignoreDirection);
     Assert.Null(result);
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:11,代码来源:BasicAdjListFixture.cs

示例5: GetEdge_With_Ignore_Direction_Param_If_Nodes_AreReversed

        public void GetEdge_With_Ignore_Direction_Param_If_Nodes_AreReversed(bool ignoreDirection, bool nullExpected)
        {
            //Arrange
            var net = new BasicAdjList(Guid.NewGuid());
            INode nodeA = net.CreateNode();
            INode nodeB = net.CreateNode();
            IEdge edge = net.CreateEdge(nodeA, nodeB);
            IEdge result = net.GetEdge(nodeB, nodeA, ignoreDirection);

            if (nullExpected)
            {
                Assert.Null(result);
            }
            else
            {
                Assert.NotNull(result);
                Assert.Same(result, edge);
            }
        }
开发者ID:BgRva,项目名称:Blob1,代码行数:19,代码来源:BasicAdjListFixture.cs

示例6: GetEdge_Throws_When_Null_Passed_In_For_Souce_Node

 public void GetEdge_Throws_When_Null_Passed_In_For_Souce_Node()
 {
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = null;
     INode nodeB = net.CreateNode();
     var ex = Assert.Throws<ArgumentNullException>(() => net.GetEdge(nodeA, nodeB));
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:7,代码来源:BasicAdjListFixture.cs

示例7: GetEdge_Throws_When_Invalid_Type_Passed_In_For_Dest_Node

 public void GetEdge_Throws_When_Invalid_Type_Passed_In_For_Dest_Node()
 {
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = net.CreateNode();
     INode nodeB = new DummyBasicNode();
     var ex = Assert.Throws<ArgumentException>(() => net.GetEdge(nodeA, nodeB));
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:7,代码来源:BasicAdjListFixture.cs

示例8: GetEdge_Returns_Null_If_Nodes_Are_Reversed_But_Edge_Exists

 public void GetEdge_Returns_Null_If_Nodes_Are_Reversed_But_Edge_Exists()
 {
     //Arrange
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = net.CreateNode();
     INode nodeB = net.CreateNode();
     IEdge edge = net.CreateEdge(nodeA, nodeB);
     IEdge result = net.GetEdge(nodeB, nodeA);
     Assert.Null(result);
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:10,代码来源:BasicAdjListFixture.cs

示例9: GetEdge_Returns_Null_If_Edge_DNE

 public void GetEdge_Returns_Null_If_Edge_DNE()
 {
     //Arrange
     var net = new BasicAdjList(Guid.NewGuid());
     INode nodeA = net.CreateNode();
     INode nodeB = net.CreateNode();
     INode nodeC = net.CreateNode();
     IEdge edge = net.CreateEdge(nodeA, nodeB);
     IEdge result = net.GetEdge(nodeC, nodeA);
     Assert.Null(result);
 }
开发者ID:BgRva,项目名称:Blob1,代码行数:11,代码来源:BasicAdjListFixture.cs


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