public void LinkshareRendersValidXhtml() { string result = "<html> <head> \n <title> </title> \n </head> \n <body> <div> \n" + LinkShare.GetHtml("any<>title", "my test page <>") + "\n </div> </body> \n </html>"; HtmlString htmlResult = new HtmlString(result); XhtmlAssert.Validate1_0(htmlResult); }
public void ReCaptchaOptionsMissingWhenNoOptionsAndDefaultRendering() { var html = ReCaptcha.GetHtml(GetContext(), "PUBLIC_KEY"); UnitTestHelper.AssertEqualsIgnoreWhitespace( @"<script src=""http://www.google.com/recaptcha/api/challenge?k=PUBLIC_KEY"" type=""text/javascript""></script>" + @"<noscript>" + @"<iframe frameborder=""0"" height=""300px"" src=""http://www.google.com/recaptcha/api/noscript?k=PUBLIC_KEY"" width=""500px""></iframe><br/><br/>" + @"<textarea cols=""40"" name=""recaptcha_challenge_field"" rows=""3""></textarea>" + @"<input name=""recaptcha_response_field"" type=""hidden"" value=""manual_challenge""/>" + @"</noscript>", html.ToString()); XhtmlAssert.Validate1_0(html, addRoot: true); }
public void RenderUsesLastError() { HttpContextBase context = GetContext(); ReCaptcha.HandleValidateResponse(context, "false\nincorrect-captcha-sol"); var html = ReCaptcha.GetHtml(context, "PUBLIC_KEY"); UnitTestHelper.AssertEqualsIgnoreWhitespace( @"<script src=""http://www.google.com/recaptcha/api/challenge?k=PUBLIC_KEY&error=incorrect-captcha-sol"" type=""text/javascript""></script>" + @"<noscript>" + @"<iframe frameborder=""0"" height=""300px"" src=""http://www.google.com/recaptcha/api/noscript?k=PUBLIC_KEY"" width=""500px""></iframe><br/><br/>" + @"<textarea cols=""40"" name=""recaptcha_challenge_field"" rows=""3""></textarea>" + @"<input name=""recaptcha_response_field"" type=""hidden"" value=""manual_challenge""/>" + @"</noscript>", html.ToString()); XhtmlAssert.Validate1_0(html, addRoot: true); }
public void ReCaptchaOptionsWhenMultipleOptionsFromDictionaryAndDefaultRendering() { // verifies that a dictionary will serialize the same as a projection var options = new Dictionary <string, object> { { "theme", "white" }, { "tabindex", 5 } }; var html = ReCaptcha.GetHtml(GetContext(), "PUBLIC_KEY", options: options); UnitTestHelper.AssertEqualsIgnoreWhitespace( @"<script type=""text/javascript"">var RecaptchaOptions={""theme"":""white"",""tabindex"":5};</script>" + @"<script src=""http://www.google.com/recaptcha/api/challenge?k=PUBLIC_KEY"" type=""text/javascript""></script>" + @"<noscript>" + @"<iframe frameborder=""0"" height=""300px"" src=""http://www.google.com/recaptcha/api/noscript?k=PUBLIC_KEY"" width=""500px""></iframe><br/><br/>" + @"<textarea cols=""40"" name=""recaptcha_challenge_field"" rows=""3""></textarea>" + @"<input name=""recaptcha_response_field"" type=""hidden"" value=""manual_challenge""/>" + @"</noscript>", html.ToString()); XhtmlAssert.Validate1_0(html, addRoot: true); }
public void RenderGeneratesValidXhtml() { XhtmlAssert.Validate1_0( GamerCard.GetHtml("osbornm") ); }