コード例 #1
0
        IEnumerable <ValidationFailure> IValidationResultTester.ShouldHaveValidationError(IEnumerable <MemberInfo> properties)
        {
            var propertyName = properties.Any() ? GetPropertyName(properties) : ValidationTestExtension.MatchAnyFailure;

            return(ValidationTestExtension.ShouldHaveValidationError(Errors, propertyName, true));
        }
コード例 #2
0
        public IEnumerable <ValidationFailure> ShouldHaveValidationErrorFor <TProperty>(Expression <Func <T, TProperty> > memberAccessor)
        {
            string propertyName = ValidatorOptions.PropertyNameResolver(typeof(T), memberAccessor.GetMember(), memberAccessor);

            return(ValidationTestExtension.ShouldHaveValidationError(Errors, propertyName, true));
        }
コード例 #3
0
 public IEnumerable <ValidationFailure> ShouldHaveValidationErrorFor(string propertyName)
 {
     return(ValidationTestExtension.ShouldHaveValidationError(Errors, propertyName, false));
 }
コード例 #4
0
 public ITestValidationWith ShouldHaveValidationErrorFor(string propertyName)
 {
     return(ValidationTestExtension.ShouldHaveValidationError(Errors, propertyName, false));
 }