public void validate_default() { VBRealizationExpeditionRejectDto dto = new VBRealizationExpeditionRejectDto(); var result = dto.Validate(null); Assert.True(0 < result.Count()); }
public async Task <IActionResult> reject([FromRoute] int id, [FromBody] VBRealizationExpeditionRejectDto viewModel) { try { VerifyUser(); _validateService.Validate(viewModel); await _service.Reject(id, viewModel.Reason); Dictionary <string, object> Result = new ResultFormatter(ApiVersion, General.CREATED_STATUS_CODE, General.OK_MESSAGE) .Ok(); return(NoContent()); } catch (ServiceValidationException e) { Dictionary <string, object> Result = new ResultFormatter(ApiVersion, General.BAD_REQUEST_STATUS_CODE, General.BAD_REQUEST_MESSAGE) .Fail(e); return(BadRequest(Result)); } catch (Exception e) { Dictionary <string, object> Result = new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message) .Fail(); return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, Result)); } }