public void InsertAfter_SingleNode_AddsNodeAfterNode_AtEnd() { // Arrange var parent = new BasicIntermediateNode("Parent"); var node1 = new BasicIntermediateNode("Node1"); var node2 = new BasicIntermediateNode("Node2"); var node3 = new BasicIntermediateNode("Node3"); parent.Children.Add(node1); parent.Children.Add(node2); var reference = new IntermediateNodeReference(parent, node2); // Act reference.InsertAfter(node3); // Assert Assert.Equal(new[] { node1, node2, node3, }, parent.Children); }
public void InsertAfter_MultipleNodes_AddsNodesAfterNode() { // Arrange var parent = new BasicIntermediateNode("Parent"); var node1 = new BasicIntermediateNode("Node1"); var node2 = new BasicIntermediateNode("Node2"); var node3 = new BasicIntermediateNode("Node3"); var node4 = new BasicIntermediateNode("Node4"); parent.Children.Add(node1); parent.Children.Add(node4); var reference = new IntermediateNodeReference(parent, node1); // Act reference.InsertAfter(new[] { node2, node3 }); // Assert Assert.Equal(new[] { node1, node2, node3, node4, }, parent.Children); }