public void Passes_object_being_validated_to_action() {
			var person = new Person();
			Person validatedPerson = null;

			validator.RuleFor(x => x.Surname).NotNull().OnAnyFailure(x => {
				validatedPerson = x;
			});

			validator.Validate(person);

			person.ShouldBeTheSameAs(validatedPerson);
		}
        public void Passes_object_being_validated_to_action()
        {
            var    person          = new Person();
            Person validatedPerson = null;

            validator.RuleFor(x => x.Surname).NotNull().OnAnyFailure(x => {
                validatedPerson = x;
            });

            validator.Validate(person);

            person.ShouldBeTheSameAs(validatedPerson);
        }
Exemple #3
0
        public void Correctly_provides_object_being_validated()
        {
            Person resultPerson = null;

            validator.RuleFor(x => x.Surname).NotNull().WithSeverity(x => {
                resultPerson = x;
                return(Severity.Warning);
            });

            var person = new Person();

            validator.Validate(person);

            resultPerson.ShouldBeTheSameAs(person);
        }