Validation Application Block – Unit Test Validation Logic
The Enterprise Library Validation Application Block (VAB) is a great library for putting your validation in your business layer where it belongs rather than in the UI. It allows us to apply attributes to the properties of our business objects like this: public class Person { [StringLengthValidator(1, 20, MessageTemplate="First Name must be between 1-20 characters.")] public string FirstName { get; set; } [StringLengthValidator(1, 20, MessageTemplate="Last Name must be between 1-2...