public async Task DeleteCheckListSucess() { var checkList = new CheckList() { Id = 1 }; await _repository.Add(checkList); Exception exception = null; try{ await _service.Execute(1); }catch (Exception ex) { exception = ex; } Assert.AreEqual(exception, null); }
public async Task <IActionResult> Delete(int id) { try { await _delete.Execute(id); return(StatusCode(204)); } catch (NotFoundRegisterException err) { return(StatusCode(404, new { Message = err.Message })); } }