public async Task <IActionResult> CanccellationDocuments([FromBody] CancellationFormDto form) { try { VerifyUser(); var result = await _service.CancellationDocuments(form); var response = new ResultFormatter(ApiVersion, General.CREATED_STATUS_CODE, General.OK_MESSAGE).Ok(null, result); return(Ok(response)); } catch (Exception e) { var result = new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message) .Fail(); return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, result)); } }
public async Task CancelDocument_Return_Succes() { //Setup var dbContext = _dbContext(GetCurrentAsyncMethod()); var service = new VBRequestDocumentService(dbContext, GetServiceProvider().Object); var data = GetdataUtil(service).GetTestData_VBRequestDocumentWithPO_Cancellation(); var form = new CancellationFormDto() { Ids = new List <int>() { data.Id } }; //Act int result = await service.CancellationDocuments(form); //Assert Assert.True(0 < result); }