本文整理汇总了C#中BlueSpider.Blob.Basic.Network.AdjList.BasicAdjList.GetEdgeCount方法的典型用法代码示例。如果您正苦于以下问题:C# BasicAdjList.GetEdgeCount方法的具体用法?C# BasicAdjList.GetEdgeCount怎么用?C# BasicAdjList.GetEdgeCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSpider.Blob.Basic.Network.AdjList.BasicAdjList
的用法示例。
在下文中一共展示了BasicAdjList.GetEdgeCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEdgeCount_With_Ignore_Direction_Param_Throws_When_Invalid_Type_Passed_In_For_Dest_Node
public void GetEdgeCount_With_Ignore_Direction_Param_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.GetEdgeCount(nodeA, nodeB, true));
}
示例2: GetEdgeCount_With_Ignore_Direction_Param_Throws_When_NullPassed_In_For_Source_Node
public void GetEdgeCount_With_Ignore_Direction_Param_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.GetEdgeCount(nodeA, nodeB, true));
}
示例3: GetEdgeCount_For_NodeB_to_NodeB
public void GetEdgeCount_For_NodeB_to_NodeB(int AtoBEdges, int BtoAEdges, int AtoAEdges, int BtoBEdges, bool ignoreDirection, int expectedCount)
{
//Arrange
var net = new BasicAdjList(Guid.NewGuid());
INode nodeA = net.CreateNode();
INode nodeB = net.CreateNode();
for (int i = 0; i < AtoBEdges; i++)
{
net.CreateEdge(nodeA, nodeB);
}
for (int i = 0; i < BtoAEdges; i++)
{
net.CreateEdge(nodeB, nodeA);
}
for (int i = 0; i < AtoAEdges; i++)
{
net.CreateEdge(nodeA, nodeA);
}
for (int i = 0; i < BtoBEdges; i++)
{
net.CreateEdge(nodeB, nodeB);
}
int result = net.GetEdgeCount(nodeB, nodeB, ignoreDirection);
Assert.Equal(expectedCount, result);
}