public void ValidateResponseReturnsFalseOnEmptyReCaptchaResponse() { HttpContextBase context = GetContext(); Assert.False(ReCaptcha.HandleValidateResponse(context, "")); Assert.Equal(String.Empty, ReCaptcha.GetLastError(context)); }
public void ValidateResponseReturnsTrueOnSuccess() { HttpContextBase context = GetContext(); Assert.True(ReCaptcha.HandleValidateResponse(context, "true\nsuccess")); Assert.Equal(String.Empty, ReCaptcha.GetLastError(context)); }
public void ValidateResponseReturnsFalseOnError() { HttpContextBase context = GetContext(); Assert.False(ReCaptcha.HandleValidateResponse(context, "false\nincorrect-captcha-sol")); Assert.Equal("incorrect-captcha-sol", ReCaptcha.GetLastError(context)); }