public void TestReplaceWithStringStructure()
        {
            // Arrange
              var sut = new ZptHtmlElement(_document.DocumentNode.FirstChild.ChildNodes[3].ChildNodes[1].ChildNodes[1],
                                   _sourceFile, Mock.Of<IZptDocument>());

              // Act
              var result = sut.ReplaceWith("<p>Replacement <strong>element</strong></p>", true);

              // Assert
              Assert.NotNull(result, "Result nullability");
              Assert.AreEqual(1, result.Length, "Count of results");
              var expectedDom = @"<html>
            <head>
            <title>Document title</title>
            </head>
            <body>
            <header>
              <p>Replacement <strong>element</strong></p>
              Page header
            </header>
            <section>
              <header>
            <h1 id=""page_heading"">Page heading</h1>
              </header>
              <p>A paragraph of content</p>
            </section>
            <footer>Page footer</footer>
            </body>
            </html>";
              Assert.AreEqual(expectedDom, _document.DocumentNode.OuterHtml, "Correct modified HTML");
        }
        public void TestReplaceWith()
        {
            // Arrange
              var sut = new ZptHtmlElement(_document.DocumentNode.FirstChild.ChildNodes[3].ChildNodes[1].ChildNodes[1],
                                _sourceFile, Mock.Of<IZptDocument>());
              var replacementHtml = "<p>Replacement element</p>";
              var secondDocument = new HtmlDocument();
              secondDocument.LoadHtml(replacementHtml);
              var secondElement = new ZptHtmlElement(secondDocument.DocumentNode.FirstChild,
                                          _sourceFile, Mock.Of<IZptDocument>());

              // Act
              var result = sut.ReplaceWith(secondElement);

              // Assert
              Assert.NotNull(result, "Result nullability");
              Assert.AreEqual("p", result.Name, "Result name");
              var expectedDom = @"<html>
            <head>
            <title>Document title</title>
            </head>
            <body>
            <header>
              <p>Replacement element</p>
              Page header
            </header>
            <section>
              <header>
            <h1 id=""page_heading"">Page heading</h1>
              </header>
              <p>A paragraph of content</p>
            </section>
            <footer>Page footer</footer>
            </body>
            </html>";
              Assert.AreEqual(expectedDom, _document.DocumentNode.OuterHtml, "Correct modified HTML");
        }