ValidateAnswer() 공개 메소드

Answer value is valid for either image or audio option
public ValidateAnswer ( string answerValue ) : bool
answerValue string This could be the hashed value of the image path or the answer to an audio question
리턴 bool
        public void ValidImageOption_Succeeds()
        {
            for (var i = 0; i < 100; i++)
            {
                var captcha = new Captcha(5);
                var data = captcha.GetFrontEndData();

                Assert.IsTrue(
                    captcha.ValidateAnswer(data.Values.FirstOrDefault(v => v == captcha.ValidImageOption.Value)));
            }
        }
        public void InvalidImageOptions_Fail()
        {
            for (var i = 0; i < 100; i++)
            {
                var captcha = new Captcha(5);
                var data = captcha.GetFrontEndData();

                foreach (var option in data.Values.Where(option => option != captcha.ValidImageOption.Value))
                {
                    Assert.IsFalse(captcha.ValidateAnswer(option));
                }
            }
        }