// Custom type
        public static ValidationResult IsValidCustomType(Customer customer, ValidationContext context) {
            if (!customer.IsValid) {
                return new ValidationResult("Customer is invalid", new[] { "IsValid" });
            }

            return null;
        }
 public void CustomValidation_CustomType_Succeeds() {
     CustomValidationAttribute cva = new CustomValidationAttribute(typeof(MockValidator), "IsValidCustomType");
     Customer cust = new Customer { IsValid = true };
     ValidationContext context = new ValidationContext(cust, null, null);
     Assert.IsNull(cva.GetValidationResult(cust, context));
 }