本文整理汇总了C#中BlueSpider.Blob.Basic.Network.AdjList.BasicAdjList.IsConnected方法的典型用法代码示例。如果您正苦于以下问题:C# BasicAdjList.IsConnected方法的具体用法?C# BasicAdjList.IsConnected怎么用?C# BasicAdjList.IsConnected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSpider.Blob.Basic.Network.AdjList.BasicAdjList
的用法示例。
在下文中一共展示了BasicAdjList.IsConnected方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsConnected_Throws_When_NullPassed_In_For_Source_Node
public void IsConnected_Throws_When_NullPassed_In_For_Source_Node()
{
var net = new BasicAdjList(Guid.NewGuid());
INode nodeA = null;
INode nodeB = net.CreateNode();
var ex = Assert.Throws<ArgumentNullException>(() => net.IsConnected(nodeA, nodeB));
}
示例2: IsConnected_Throws_When_Invalid_Type_Passed_In_For_Dest_Node
public void IsConnected_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.IsConnected(nodeA, nodeB));
}
示例3: IsConnected_ReturnsTrueFor_Self_Looped_Edges
public void IsConnected_ReturnsTrueFor_Self_Looped_Edges()
{
//Arrange
var net = new BasicAdjList(Guid.NewGuid());
INode nodeA = net.CreateNode();
INode nodeB = net.CreateNode();
IEdge edge = net.CreateEdge(nodeB, nodeB);
bool result = net.IsConnected(nodeB, nodeB);
Assert.True(result);
}
示例4: IsConnected_ReturnsTrueIf_Nodes_AreReversedButEdgeExists
public void IsConnected_ReturnsTrueIf_Nodes_AreReversedButEdgeExists()
{
//Arrange
var net = new BasicAdjList(Guid.NewGuid());
INode nodeA = net.CreateNode();
INode nodeB = net.CreateNode();
IEdge edge = net.CreateEdge(nodeA, nodeB);
bool result = net.IsConnected(nodeB, nodeA);
Assert.True(result);
}
示例5: IsConnected_ReturnsFalseIfEdgeDNE
public void IsConnected_ReturnsFalseIfEdgeDNE()
{
//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);
bool result = net.IsConnected(nodeC, nodeA);
Assert.False(result);
}