public void SkipAttributesTests(string htmlInput, string expectedOutput) { //Act string result = Textorize.HtmlToPlainText(htmlInput); //Assert result.Should().Be(expectedOutput); }
//[TestCase(" \nhello hoi \n ")] public void TextorizeTwiceOverPlainTextShouldHaveEqualResults(string input) { var first = Textorize.HtmlToPlainText(input); var second = Textorize.HtmlToPlainText(first); first.Should().BeEquivalentTo(second); Textorize.HtmlToPlainText(WebUtility.HtmlEncode(second)).Should().BeEquivalentTo(first); }
public void HtmlFileShouldGiveSomeReasonableResult() { //Arrange var testFilename = Path.Join(TestContext.CurrentContext.TestDirectory, "testdata", "input_html_01.html"); //Act var result = Textorize.HtmlToPlainText(File.ReadAllText(testFilename)); File.WriteAllText(Path.Join(TestContext.CurrentContext.TestDirectory, "input_html_01-sanitized.txt"), result); //Assert Console.Write(result); }
public void HtmlFileTwiceShouldBeEquivalent() { //Arrange var testFilename = Path.Join(TestContext.CurrentContext.TestDirectory, "testdata", "input_html_01.html"); //Act var first = Textorize.HtmlToPlainText(File.ReadAllText(testFilename)); var second = Textorize.HtmlToPlainText(WebUtility.HtmlEncode(first)); File.WriteAllText(Path.Join(TestContext.CurrentContext.TestDirectory, "input_html_01-2-sanitized.txt"), second); //Assert Textorize(input) == Textorize(HtmlEncode(Textorize(input))) first.Should().BeEquivalentTo(second); }
public void PropertyTestsShouldNotThrowException(string inputA, string inputB) { //Act Textorize.HtmlToPlainText(inputA + inputB); }