public static void ThrowIfAny(this IEnumerable<string> messages)
        {
            if (messages == null) return;
            if (!messages.Any()) return;

            var exception = new ValidationException();

            foreach (var message in messages)
                exception.AddError(message);

            throw exception;
        }
 public void SetUp()
 {
     exception = new ValidationException();
 }
 public void SetUp()
 {
     exception = new ValidationException();
     exception.AddError("User error message");
 }