Exemple #1
0
        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"));
        }
Exemple #2
0
        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 &lt;a href=&quot;http://bloomlibrary.org&quot;&gt;Bloom Library&lt;/a&gt; for help"));
        }