예제 #1
0
        public void ValidateResponseReturnsFalseOnEmptyReCaptchaResponse()
        {
            HttpContextBase context = GetContext();

            Assert.False(ReCaptcha.HandleValidateResponse(context, ""));
            Assert.Equal(String.Empty, ReCaptcha.GetLastError(context));
        }
예제 #2
0
        public void ValidateResponseReturnsTrueOnSuccess()
        {
            HttpContextBase context = GetContext();

            Assert.True(ReCaptcha.HandleValidateResponse(context, "true\nsuccess"));
            Assert.Equal(String.Empty, ReCaptcha.GetLastError(context));
        }
예제 #3
0
        public void ValidateResponseReturnsFalseOnError()
        {
            HttpContextBase context = GetContext();

            Assert.False(ReCaptcha.HandleValidateResponse(context, "false\nincorrect-captcha-sol"));
            Assert.Equal("incorrect-captcha-sol", ReCaptcha.GetLastError(context));
        }