Пример #1
0
        public void ShouldGetContentByXPath()
        {
            var doc  = new HtmlDocument();
            var node = HtmlNode.CreateNode("<html><head></head><body><div>Test</div></body></html>");

            doc.DocumentNode.AppendChild(node);

            var xpath = "/html/body/div";

            var expectedContent = "Test";
            var actualContent   = _contentHandler.GetContentByXPath(doc, xpath);

            Assert.AreEqual(expectedContent, actualContent);
        }