Пример #1
0
        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);
        }
Пример #2
0
 public IActionResult Delete(long id)
 {
     try
     {
         response = _IManageTask.DeleteTask(id);
         var json = JsonConvert.SerializeObject(response, _serializerSettings);
         return(new OkObjectResult(json));
     }
     catch { throw; }
 }
Пример #3
0
        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));
        }