本文整理汇总了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));
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}