public async Task <IActionResult> CancelImport(string idParameter) { CancelImportResponse response = await _mediator.CancelImportAsync(idParameter, HttpContext.RequestAborted); _logger.LogInformation($"CancelImport {response.StatusCode}"); return(new ImportResult(response.StatusCode)); }
public async Task GivenAFhirMediator_WhenCancelingWithNotExistTask_ThenNotFoundShouldBeReturned() { _taskManager.CancelTaskAsync(Arg.Any <string>(), _cancellationToken).Returns <Task <TaskInfo> >(_ => throw new TaskNotExistException("Task not exist.")); await Assert.ThrowsAsync <ResourceNotFoundException>(async() => await _mediator.CancelImportAsync(TaskId, _cancellationToken)); }