public IHttpActionResult GetTask(int id) { Task task = taskBusiness.GetTask(id); if (task == null) { return(NotFound()); } return(Ok(task)); }
public void GetTaskTest() { //Arrange TaskBusiness taskBusiness = new TaskBusiness(); //Act Task task = taskBusiness.GetTask(4); //Assert if (task != null) { Assert.AreEqual(4, task.TaskId); } else { Assert.IsNotNull(task); } }
public void GetTaskDetailByIdPass() { TaskParentDetail objTaskParentDetail = new TaskParentDetail(); objTaskParentDetail.Parent_Id = 2; objTaskParentDetail.Range = 30; objTaskParentDetail.Task_Name = "Task 3"; objTaskParentDetail.parentTaskName = "Parent Task 2"; objTaskParentDetail.Start_Date = DateTime.Parse("Jan 1, 2017"); objTaskParentDetail.End_Date = DateTime.Parse("Jan 1, 2018"); TaskBusiness objTaskBusiness = new TaskBusiness(); TaskParentDetail objTaskParentDetailNew = new TaskParentDetail(); objTaskParentDetailNew = objTaskBusiness.GetTask(3); Assert.AreEqual(objTaskParentDetailNew, objTaskParentDetail); }
// GET: api/Employee/5 public TaskParentDetail Get(int id) { return(obj.GetTask(id)); }