Example #1
0
        public void HtmlToTextParser_HtmlTemplateIsProperlyParsed_ShouldPass(string pathToHtmlTemplate, string pathToTxtTemplate)
        {
            var htmlParser = new HtmlToTextParser();
            var htmlTemplate = GetTemplate(pathToHtmlTemplate);
            var actualTextTemplate = htmlParser.Parse(htmlTemplate).Replace("\r\n", "").Replace("\n", "");
            var expectedTextTemplate = GetTemplate(pathToTxtTemplate).Replace("\r\n", "").Replace("\n", "");

            Assert.Equal(expectedTextTemplate, actualTextTemplate);
        }
        private string GetText()
        {
            var parser = new HtmlToTextParser();
            dynamic doc = WebBrowser.Document;
            var htmlText = doc.documentElement.InnerHtml;

            return parser.Parse(htmlText);
        }