public void SearchBoxGeneratesValidHtml()
 {
     // Act & Assert
     XhtmlAssert.Validate1_0(
         Bing._SearchBox("322px", null, null, GetContextForSearchBox(), _emptyStateStorage), true
         );
 }
        public void _GetHtmlWithoutFormTagProducesValidXhtml()
        {
            // Act
            var result = FileUpload._GetHtml(GetContext(), name: null, includeFormTag: false, initialNumberOfFiles: 1, allowMoreFilesToBeAdded: false, addText: null, uploadText: null);

            XhtmlAssert.Validate1_1(result, "div");
        }
Exemple #3
0
        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 ListRendersRendersValidXhtml()
        {
            string result = "<html> <head> \n <title> </title> \n </head> \n <body> \n" +
                            Twitter.List("any<>Name", "my-list") +
                            "\n </body> \n </html>";
            HtmlString htmlResult = new HtmlString(result);

            XhtmlAssert.Validate1_1(htmlResult);
        }
        public void SearchRendersRendersValidXhtml()
        {
            string result = "<html> <head> \n <title> </title> \n </head> \n <body> \n" +
                            Twitter.Search("any<>term") +
                            "\n </body> \n </html>";
            HtmlString htmlResult = new HtmlString(result);

            XhtmlAssert.Validate1_1(htmlResult);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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&amp;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);
        }
Exemple #8
0
        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")
         );
 }
 public void RendersValidXhtml()
 {
     XhtmlAssert.Validate1_1(Gravatar.GetHtml("*****@*****.**"));
 }