示例#1
0
        public void TestExistsNodeWithInvalidAttribute()
        {
            // Arrange
            const string contents =
                @"<html>
                    <body>
                        <span class='col'>test</span>
                    </body>
                  </html>";
            var doc = new HtmlParser(contents);

            // Act
            var result = doc.ExistsNode("//span", "id");

            // Arrange
            Assert.IsFalse(result);
        }
示例#2
0
        public void TestExistsNodeWithInvalidXPath()
        {
            // Arrange
            const string contents =
                @"<html>
                    <body>
                        <span>test</span>
                    </body>
                  </html>";
            var doc = new HtmlParser(contents);

            // Act
            var result = doc.ExistsNode("//div", null);

            // Arrange
            Assert.IsFalse(result);
        }
示例#3
0
        public void TestExistsNode()
        {
            // Arrange
            const string contents =
                @"<html>
                    <body>
                        <span>test</span>
                    </body>
                  </html>";
            var doc = new HtmlParser(contents);

            // Act
            var result = doc.ExistsNode("//span", null);

            // Arrange
            Assert.IsTrue(result);
        }