private static IExpression <IValidationResult, int> CreateExpression(bool valid, params IValidationViolation[] violations) { var validationResult = new ValidationResult { Valid = valid }; if (violations != null) { foreach (var violation in violations) { validationResult.AddViolation(violation); } } return(new TestableExpression { ValidationResult = validationResult }); }