public async Task VerifyDeleteFuntion() { var taskDetail = TestData.GetTasks().Where(task => task.Id == 114).FirstOrDefault(); await _manageTask.DeleteTask(taskDetail); _taskRepository.Verify(r => r.DeleteTask(taskDetail), Times.Once); }
public IActionResult Delete(long id) { try { response = _IManageTask.DeleteTask(id); var json = JsonConvert.SerializeObject(response, _serializerSettings); return(new OkObjectResult(json)); } catch { throw; } }
public async Task <IActionResult> Delete(int id) { var task = await _manageTask.GetTask(id); if (task == null) { return(NotFound("No Task found with given taskId:" + id)); } await _manageTask.DeleteTask(task); return(Ok(task.Id)); }