예제 #1
0
        // GET: Home
        public ActionResult Index()
        {
            string cptvalue = null;

            ViewData["captcha"] = IgniteCaptcha.GenCaptcha(Path.Combine(Directory.GetCurrentDirectory(), @"output"), 300, 150, out cptvalue);
            HttpContext.Session.SetString("CaptchaValue", cptvalue);
            return(View());
        }
예제 #2
0
 public void MinGetColor()
 {
     Assert.AreEqual(SixLabors.ImageSharp.Rgba32.AliceBlue, IgniteCaptcha.GetColor(0));
 }
예제 #3
0
 public void OverMaxGetColor()
 {
     Assert.ThrowsException <System.IndexOutOfRangeException>(
         () => { IgniteCaptcha.GetColor(142); });
 }
예제 #4
0
 public void LessMinGetColor()
 {
     Assert.ThrowsException <System.IndexOutOfRangeException>(
         () => { IgniteCaptcha.GetColor(-1); });
 }
예제 #5
0
 public void MaxGetColor()
 {
     Assert.AreEqual(SixLabors.ImageSharp.Rgba32.YellowGreen, IgniteCaptcha.GetColor(141));
 }