Ejemplo n.º 1
0
            public void WhenTryValidateIsCalled_Then_ResultIsFalseAndValidationErrorsAreReturned()
            {
                List <ValidationResult> errors;
                bool isValid = ValidatorUtil.TryValidate(subject, out errors);

                Assert.IsFalse(isValid);
                Assert.AreEqual(4, errors.Count); // four errors
            }
Ejemplo n.º 2
0
 public void WhenValidateIsCalled_Then_ValidateExceptionIsThrown()
 {
     Assert.Throws <ValidationException>(() => ValidatorUtil.Validate(subject));
 }
Ejemplo n.º 3
0
 public void WhenValidateAllIsCalled_Then_AggregateExceptionContainingAllValidateExceptionsIsThrown()
 {
     Assert.Throws <AggregateException>(() => ValidatorUtil.ValidateAll(subject));
 }
Ejemplo n.º 4
0
 public void WhenValidateAllIsCalled_Then_NoErrorOccurs()
 {
     ValidatorUtil.ValidateAll(subject);
 }