//Test Method for GetByTask Id public void GetTaskByIdTest() { int id = 1; var task = blObj.GetTaskById(id); Assert.IsNotNull(task); }
public void GetTaskByIdTest() { Mock <TaskManagerEntities> mockContext = MockDataSetList(); var taskManagerBL = new TaskManagerBL(mockContext.Object); var task = taskManagerBL.GetTaskById(1); Assert.IsNotNull(task); Assert.AreEqual(1, task.TaskID); }
//Method used to get task item by id public IHttpActionResult GetTaskById(int Id) { blObject = new TaskManagerBL(); Task task = blObject.GetTaskById(Id); if (task == null) { return(NotFound()); } return(Ok(task)); }
public IHttpActionResult GetTaskById(int id) { Tasks task = new Tasks(); task = taskBL.GetTaskById(id); if (task != null) { return(Ok(task)); } else { return(StatusCode(HttpStatusCode.NotFound)); } }
public IHttpActionResult GetTaskById(int taskId) { TaskModel task = new TaskModel(); var blTasks = taskManagerBL.GetTaskById(taskId); if (blTasks != null) { task = new TaskModel { TaskID = blTasks.TaskID, Task = blTasks.Task, ParentTask = blTasks.ParentTask, Priority = blTasks.Priority, StartDate = blTasks.StartDate, EndDate = blTasks.EndDate, IsActive = blTasks.IsActive }; } return(Ok(task)); }
public void Test_GetTaskById() { DataLayer.Task objTsk = new DataLayer.Task() { Task1 = "Task1", Start_Date = new DateTime(2018, 08, 14), End_Date = new DateTime(2018, 08, 20), Priority = 10, ParentTask = new ParentTask() { Parent_Task = "ParentTask1" } }; Mock <ITaskDbService> mockDb = new Mock <ITaskDbService>(); TaskManagerBL obj = new TaskManagerBL(mockDb.Object); mockDb.Setup(c => c.GetTaskById(It.IsAny <Int32>())).Returns(objTsk); var expectedTaskName = "Task1"; var result = obj.GetTaskById(1); Assert.AreEqual(expectedTaskName, result.TaskName); }
//Performance checking for All particular list item been retrieved public void GetTaskByIdTest() { int id = 1; blObj.GetTaskById(id); }