Ejemplo n.º 1
0
        public async Task Create_UserTask_Success()
        {
            var containerId = _context.TasksContainers.First().ListId;
            var userTask    = new UserTaskModel()
            {
                TextTask = "Какой то текст",
                EndTime  = DateTime.Now
            };

            //act
            var resultId = await _service.AddAsync(containerId, userTask);

            var resultTask = await _context.Tasks.SingleOrDefaultAsync(x => x.TaskId == resultId);

            //assert
            Assert.AreEqual(userTask.TextTask, resultTask.TextTask);
            Assert.AreEqual(userTask.EndTime, resultTask.EndTime);
        }
Ejemplo n.º 2
0
 public async Task <object> AddTask([FromBody] UserTaskModel model, Guid idContainer)
 {
     return(await _userTaskService.AddAsync(idContainer, model));
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> AddNewUserTask([FromBody] UserTaskPostDto userTaskPostDto)
        {
            var userTaskResp = await userTaskService.AddAsync(userTaskPostDto);

            return(CreatedAtAction("GetUserTaskById", new { userId = userTaskResp.UserID, taskId = userTaskResp.TaskID }, mapper.Map <UserTaskResponseDto>(userTaskResp)));
        }