public void Test_IsChild_ParentsChild() { GraphNode<string> parentGraphNode = new GraphNode<string>("parent"); GraphNode<string> childGraphNode = new GraphNode<string>("child"); parentGraphNode.AddChild(childGraphNode); Assert.That(parentGraphNode.IsChild(childGraphNode)); }
public void Test_IsChild_Self() { GraphNode<string> graphNode = new GraphNode<string>(string.Empty); Assert.That(!graphNode.IsChild(graphNode)); }
public void Test_IsChild_NoChild() { GraphNode<string> parentGraphNode = new GraphNode<string>("parent"); GraphNode<string> randomGraphNode = new GraphNode<string>("random"); Assert.That(!parentGraphNode.IsChild(randomGraphNode)); }