TestReplaceHrefElements() public method

public TestReplaceHrefElements ( HtmlNode root ) : void
root HtmlAgilityPack.HtmlNode
return void
        public void ReplaceHrefElements_WhenLinkIsImageWithNoAltTag_DoesReplaceHrefElementsWithUrl()
        {
            // Arrange
            var parser = new HtmlAgilityPackParserTester(Uri);
            Html.LoadHtml("<html><body>This is a test <a href=\"http://www.wduffy.co.uk\"><img src=\"test.jpg\" /></a> image link.</body></html>");

            // Act
            parser.TestReplaceHrefElements(Html.DocumentNode);

            // Assert
            Assert.That(Html.DocumentNode.InnerText, Is.StringContaining("This is a test http://www.wduffy.co.uk image link."));
        }
        public void ReplaceHrefElements_WhenLinkTextIsAvailable_DoesReplaceHrefElementsWithTextAndUrl()
        {
            // Arrange
            var parser = new HtmlAgilityPackParserTester(Uri);
            Html.LoadHtml("<html><body>This is a test <a href=\"http://www.wduffy.co.uk\">link</a>.</body></html>");

            // Act
            parser.TestReplaceHrefElements(Html.DocumentNode);

            // Assert
            Assert.That(Html.DocumentNode.InnerText, Is.StringContaining("This is a test link [ http://www.wduffy.co.uk ]."));
        }
        public void ReplaceHrefElements_WhenLinkIsEmailAddress_DoesReplaceHrefWithEmailAddressWithoutMailTo()
        {
            // Arrange
            var parser = new HtmlAgilityPackParserTester(Uri);
            Html.LoadHtml("<html><body>This is a test <a href=\"mailto:" + ObjectMother.TestAddress +"\">email address</a>.</body></html>");

            // Act
            parser.TestReplaceHrefElements(Html.DocumentNode);

            // Assert
            Assert.That(Html.DocumentNode.InnerText, Is.StringContaining("This is a test email address [ " + ObjectMother.TestAddress + " ]."));
        }