public void Getbytask() { TaskBL obj = new TaskBL(); List <Task> Ts = obj.GetTask(); //Task count = obj.GetTaskbyId(1); Task count = obj.GetTaskbyId(Ts[0].TaskId); Assert.IsNotNull(count); // Assert.Greater(count, 0); }
public void DeleteTask() { TaskBL obj = new TaskBL(); List <Task> Ts = obj.GetTask(); Task Taskgetbyid = obj.GetTaskbyId(Ts[0].TaskId); int count1 = obj.GetTask().Count(); //dynamic testtask = new (Task) list<Task>; //Task T = (new Task { TaskId = 1015, ParentName = "ParentTaskstest", TaskName = "Testtaskname", Priority = 15, SDate = DateTime.Now, EDate = DateTime.Now }); obj.DeleteTask(Taskgetbyid.TaskId); int count2 = obj.GetTask().Count(); Assert.AreEqual(count2, count1 - 1); }
public void updateTask() { TaskBL obj = new TaskBL(); List <Task> Ts = obj.GetTask(); Task Taskgetbyid = obj.GetTaskbyId(Ts[0].TaskId); int count = obj.GetTask().Count(); //dynamic testtask = new (Task) list<Task>; Task T = (new Task { TaskId = Taskgetbyid.TaskId, ParentName = "ParentTaskstest", TaskName = "Testtaskname", Priority = 15, SDate = DateTime.Now, EDate = DateTime.Now }); obj.UpdateTask(T); int count1 = obj.GetTask().Count(); List <Task> TS1 = obj.GetTask(); //Assert.AreEqual(count1, count ); Assert.AreEqual(T.TaskName, TS1[0].TaskName); }
public IHttpActionResult Get(int id) { TaskBL ts = new TaskBL(); return(Ok(ts.GetTaskbyId(id))); }