public void InsertTextNodeBeforeWithNullOwner()
 {
     InsertTextNodeBeforeCommand command = new InsertTextNodeBeforeCommand();
     command.Run();
 }
        public void InsertTextNodeBefore()
        {
            AddChildTextNode();

            XmlText textNode = bodyElement.SelectSingleNode("text()") as XmlText;
            textNode.Value = "Original";

            XmlTextTreeNode textTreeNode = bodyTreeNode.Nodes[0] as XmlTextTreeNode;
            treeView.SelectedNode = textTreeNode;
            InsertTextNodeBeforeCommand command = new InsertTextNodeBeforeCommand();
            command.Owner = treeViewContainer;
            command.Run();

            XmlTextTreeNode insertedTextTreeNode = bodyTreeNode.Nodes[0] as XmlTextTreeNode;
            XmlText insertedTextNode = bodyElement.FirstChild as XmlText;
            Assert.IsNotNull(insertedTextTreeNode);
            Assert.AreEqual(2, bodyTreeNode.Nodes.Count);
            Assert.AreEqual(String.Empty, insertedTextTreeNode.XmlText.Value);
            Assert.IsNotNull(insertedTextNode);
            Assert.AreEqual(2, bodyElement.ChildNodes.Count);
            Assert.AreEqual(String.Empty, insertedTextNode.Value);
        }