示例#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));
 }