AjaxControlToolkit.Tests.HtmlSanititzer.DefaultHtmlsanitizerSanitizerTests.DivProtocolResolutionScriptXSSTest C# (CSharp) Метод

DivProtocolResolutionScriptXSSTest() приватный Метод

private DivProtocolResolutionScriptXSSTest ( ) : void
Результат void
        public void DivProtocolResolutionScriptXSSTest()
        {
            // Arrange
            DefaultHtmlSanitizer target = new DefaultHtmlSanitizer();
            Dictionary<string, string[]> elementWhiteList = CreateElementWhiteList();

            // Act
            string htmlFragment = "<Div style=\"background-color: http://www.codeplex.com?url=<SCRIPT SRC=//ha.ckers.org/.j>\">";
            string actual = target.GetSafeHtmlFragment(htmlFragment, elementWhiteList);

            // Assert
            string expected = "<div style=\"background-color: http://www.codeplex.com?url=&lt;SRC=//ha.ckers.org/.j&gt;\"></div>";
            StringAssert.AreEqualIgnoringCase(expected, actual);
        }
DefaultHtmlsanitizerSanitizerTests