public void ValidateProperty(MyTestType toValidate, string propertyToValidate, Func<MyTestType, object> valueProvider, bool shouldBeValid) { var validator = new DataAnnotationsValidatorFixture().Build(); var result = validator.ValidateProperty(toValidate, propertyToValidate, valueProvider(toValidate)); if (shouldBeValid) { Assert.True(result.IsValid); } else { Assert.False(result.IsValid); Assert.True(result.ValidationResults.Any()); } }