public void GetTaskById() { var token = InstanceFactory.AuthorizedUserId(); var course = InstanceFactory.Course(); course = _courseService.Create(course, token); var courseTask = InstanceFactory.CourseTask(token, course.Id); var createdTask = _courseTaskService.Create(courseTask, token); var taskById = _courseTaskService.Get(createdTask.Id, token); Assert.IsNotNull(taskById); Assert.AreEqual(token, taskById.AuthorId); Assert.AreEqual(course.Id, taskById.CourseId); }
public ActionResult <CourseTask> Get(Guid id) { Guid userId = Guid.Parse(User.Identity.Name); return(_courseTaskService.Get(id, userId)); }