public void ReportHeadingHtml_GivenPreEncodedHtmlInSummary_ReturnsRawHtmlDirectly() { bool isSummaryPreEncoded = true; SetupApiHandler(GetDefaultBookSelection()); ProblemReportApi.GatherReportInfoExceptScreenshot(null, "Fake Details", "Fake Problem: See <a href=\"http://bloomlibrary.org\">Bloom Library</a> for help", isSummaryPreEncoded); var result = ApiTest.GetString(_server, "problemReport/reportHeadingHtml"); Assert.That(result, Is.EqualTo("Fake Problem: See <a href=\"http://bloomlibrary.org\">Bloom Library</a> for help")); }
public void ReportHeadingHtml_GivenUnencodedHtmlInSummary_EncodesTheHtml() { bool isSummaryPreEncoded = false; SetupApiHandler(GetDefaultBookSelection()); ProblemReportApi.GatherReportInfoExceptScreenshot(null, "Fake Details", "Fake Problem: See <a href=\"http://bloomlibrary.org\">Bloom Library</a> for help", isSummaryPreEncoded); var result = ApiTest.GetString(_server, "problemReport/reportHeadingHtml"); Assert.That(result, Is.EqualTo("Fake Problem: See <a href="http://bloomlibrary.org">Bloom Library</a> for help")); }