public async Task VerifyEditFuntion()
        {
            var taskDetail = TestData.GetTasks().Where(task => task.Id == 115).FirstOrDefault();

            await _manageTask.EditTask(taskDetail);

            _taskRepository.Verify(r => r.EditTask(taskDetail), Times.Once);
        }
Beispiel #2
0
        public async Task <IActionResult> Put(int id, [FromBody] TaskDetail taskDetail)
        {
            if (!ModelState.IsValid || taskDetail == null || id != taskDetail.Id)
            {
                return(BadRequest("Invalid task details."));
            }

            await _manageTask.EditTask(taskDetail);

            return(Ok(taskDetail.Id));
        }