public void HttpStatusCodeStatus(HttpStatusCode httpStatusCode, ErrorResultType errorResultType) { var httpMessage = new HttpRequestMessage(HttpMethod.Get, "localhost"); var restResponse = GetRestResponse(httpStatusCode, httpStatusCode.ToString(), httpMessage); var errorResult = RestStatusError.RestStatusToErrorResult(restResponse); Assert.Equal(errorResultType, errorResult.ErrorResultType); }
public ErrorResult(ErrorResultType errorResultType, string description, Exception?exception) { ErrorResultType = errorResultType; Description = description; Exception = exception; }
public string ToString(string?format, IFormatProvider?formatProvider) => ErrorResultType.ToString();
public ErrorResult(ErrorResultType errorResultType, string description) : this(errorResultType, description, null) { }
public BadRequestException(string field, string fieldMessage, ErrorResultType type) : base(field, fieldMessage, type) { }
public BaseException(string field, string fieldMessage, ErrorResultType type) { this.Errors.Add(new ValidationError(field, fieldMessage, type)); }
public NotFoundException(string field, string fieldMessage, ErrorResultType type) : base(field, fieldMessage, type) { }
public ValidationError(string field, string message, ErrorResultType type) { this.Field = field; this.Message = message; this.Type = type; }