public void Validate_NoValidationErrors_DontThrowException() { ReflectionLibrary.SetValueToReadonlyProperty(_validationResults.Object, typeof(ValidationResult), "Errors", _emptyValidationFailures); Assert.DoesNotThrow(() => _service.Validate(_objectToValidate.Object)); }
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>()); }