public void ImmediateDescendantsReturnsChildrenOfTheNode(int node, int[] expectedImmediateDescendants) { var graph = GraphTestHelper.CreateExampleGraph_ForImmediateTests(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedImmediateDescendants, graph.Find(node).ImmediateDescendants); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.Find(node).ImmediateDescendants); }
public void PrecedentsReturnsPrecedentsOfTheNode(int node, int[] expectedPrecedents) { var graph = GraphTestHelper.CreateExampleGraph(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedPrecedents, graph.Find(node).Precedents); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.Find(node).Precedents); }
public void GetNeighboursReturnsNeighboursOfTheNodeInTheRangeOfLevels(int node, int[] expectedNeighbours) { var graph = GraphTestHelper.CreateExampleGraph(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedNeighbours, graph.Find(node).GetNeighbours(-1, 2)); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.Find(node).GetNeighbours(-1, 2)); }
public void TerminatingDescendantsReturnsDescendantsOfTheNodeOnTheLastLevel(int node, int[] expectedTerminatingDescendants) { var graph = GraphTestHelper.CreateExampleGraph(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedTerminatingDescendants, graph.Find(node).TerminatingDescendants); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.Find(node).TerminatingDescendants); }
public void GetNodesWithBetweenReturnsNodesOnTheLevelsInTheRange(int levelFrom, int levelTo, int[] expectedNodes) { var graph = GraphTestHelper.CreateExampleGraph(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedNodes, graph.GetNodesBetween(levelFrom, levelTo)); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.GetNodesBetween(levelFrom, levelTo)); }
public void GetNodesReturnsNodesOnTheLevel(int level, int[] expectedNodes) { var graph = GraphTestHelper.CreateExampleGraph(TargetGraph); GraphTestHelper.AssertCollectionsConsistsOfNodes(expectedNodes, graph.GetNodes(level)); GraphTestHelper.AssertNodesAreOrderedByLevel(graph.GetNodes(level)); }