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

            await _manageTask.InsertTask(taskDetail);

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

            await _manageTask.InsertTask(taskDetail);

            return(Ok(taskDetail.Id));
        }