// 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()); }
public void MinGetColor() { Assert.AreEqual(SixLabors.ImageSharp.Rgba32.AliceBlue, IgniteCaptcha.GetColor(0)); }
public void OverMaxGetColor() { Assert.ThrowsException <System.IndexOutOfRangeException>( () => { IgniteCaptcha.GetColor(142); }); }
public void LessMinGetColor() { Assert.ThrowsException <System.IndexOutOfRangeException>( () => { IgniteCaptcha.GetColor(-1); }); }
public void MaxGetColor() { Assert.AreEqual(SixLabors.ImageSharp.Rgba32.YellowGreen, IgniteCaptcha.GetColor(141)); }