Project Description

NEnsure is a fast, lightweight, easy-to-use validation framework that aims to make validation methods short, sweet, and understandable.

Example Usage:

IValidator validator = new ManualValidator();

RegisterRequest request = new RegisterRequest();

request.Username = "Invalid Username";
request.Password = " ";
request.Email = "valid@email.com";
request.ConfirmEmail = "not@same.com";
request.AgreeToTOS = false;

validator.Ensure("Username", request.Username).Satisfies(Rule.IsRequired, Rule.IsUsername);
validator.Ensure("Password", request.Password).Satisfies(Rule.IsRequired);
validator.Ensure("Email", request.Email).Satisfies(Rule.IsRequired, Rule.IsEmail);
validator.Ensure("ConfirmEmail", request.ConfirmEmail).Satisfies(Rule.IsSameAs("Email", request.Email));
validator.Ensure("AgreeToTOS", request.AgreeToTOS).Satisfies(Rule.GetEqualToRuleForType(true));

validator.EnsureAll();


Latest Release: Version 0.9

Last edited Dec 13, 2008 at 6:41 PM by simplygold, version 11