Ejemplo n.º 1
0
        public void Validate_NoValidationErrors_DontThrowException()
        {
            ReflectionLibrary.SetValueToReadonlyProperty(_validationResults.Object, typeof(ValidationResult),
                                                         "Errors", _emptyValidationFailures);

            Assert.DoesNotThrow(() => _service.Validate(_objectToValidate.Object));
        }
Ejemplo n.º 2
0
        public void Validate_ValidationFailed_ThrowValidationException()
        {
            ReflectionLibrary.SetValueToReadonlyProperty(_validationResults.Object, typeof(ValidationResult),
                                                         "Errors", _notEmptyValidationFailures);

            Assert.That(() => _service.Validate(_objectToValidate.Object), Throws.Exception.TypeOf <Common.Exceptions.ValidationException>());
        }