public void MoveNodeAfterSiblingWithNullParentThrows() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.MoveAfter(testNode.Nodes[0], new TestConfigurationNode("Not A Child")); }
public void MoveNodeAfterSiblingWithNullSiblingNodeThrows() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.AddNode(new TestConfigurationNode("ATest")); testNode.AddNode(new TestConfigurationNode("CTest")); testNode.MoveAfter(testNode.Nodes[0], null); }
public void MoveNodeAfterSiblingWithDifferentParrent() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.AddNode(new TestConfigurationNode("BTest")); TestConfigurationNode testNode2 = new TestConfigurationNode("Test2"); testNode2.AddNode(new TestConfigurationNode("ATest")); testNode.MoveAfter(testNode2.Nodes[0], testNode.Nodes[0]); }
public void MoveNodeAfterWithNullSiblingNode() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); CreateHierarchyAndAddToHierarchyService(testNode, CreateDefaultConfiguration()); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.AddNode(new TestConfigurationNode("ATest")); testNode.AddNode(new TestConfigurationNode("CTest")); testNode.MoveAfter(testNode.ChildNodes[0], null); }
public void CanMoveNodeAfterSiblingNode() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.AddNode(new TestConfigurationNode("ATest")); testNode.AddNode(new TestConfigurationNode("CTest")); ConfigurationNode nodeA = (ConfigurationNode)testNode.Nodes[1]; testNode.MoveAfter(testNode.Nodes[0], nodeA); Assert.AreEqual("BTest", nodeA.NextSibling.Name); }
public void MoveAfterTest() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); CreateHierarchyAndAddToHierarchyService(testNode, CreateDefaultConfiguration()); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.AddNode(new TestConfigurationNode("ATest")); testNode.AddNode(new TestConfigurationNode("CTest")); ConfigurationNode nodeA = testNode.ChildNodes[1]; testNode.MoveAfter(testNode.ChildNodes[0], nodeA); Assert.AreEqual("BTest", nodeA.NextSibling.Name); }
public void CanMoveNodeAfterSiblingNode() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.AddNode(new TestConfigurationNode("BTest")); testNode.AddNode(new TestConfigurationNode("ATest")); testNode.AddNode(new TestConfigurationNode("CTest")); ConfigurationNode nodeA = (ConfigurationNode)testNode.Nodes[1]; testNode.MoveAfter(testNode.Nodes[0], nodeA); Assert.AreEqual("BTest", nodeA.NextSibling.Name); string[] expectedNames = new string[] { "ATest", "BTest", "CTest" }; Assert.AreEqual(expectedNames.Length, testNode.Nodes.Count); for (int i = 0; i < expectedNames.Length; ++i) { Assert.AreEqual(expectedNames[i], testNode.Nodes[i].Name); } }
public void MoveNodeAfterSiblingWithNullChildNodeThrows() { TestConfigurationNode testNode = new TestConfigurationNode("Test"); testNode.MoveAfter(null, null); }