public void Getbytask() { ProjectBAL obj = new ProjectBAL(); List <tblTask> Ts = obj.GetTask(); //Task count = obj.GetTaskbyId(1); tblTask count = obj.GetTaskbyId(Ts[0].TaskId); Assert.IsNotNull(count); // Assert.Greater(count, 0); }
public IHttpActionResult Get(int id) { if (id == 0) { return(null); } ProjectBAL obj = new ProjectBAL(); return(Ok(obj.GetTaskbyId(id))); }
public void DeleteTask() { ProjectBAL obj = new ProjectBAL(); List <tblTask> Ts = obj.GetTask(); tblTask 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() { ProjectBAL obj = new ProjectBAL(); List <tblTask> Ts = obj.GetTask(); tblTask Taskgetbyid = obj.GetTaskbyId(Ts[0].TaskId); int count = obj.GetTask().Count(); //dynamic testtask = new (Task) list<Task>; tblTask T = (new tblTask { TaskId = Ts[0].TaskId, TaskName = "taskname", TStartDate = DateTime.Now, TEndDate = DateTime.Now, TPriority = 10, TStatus = false, ParentTaskName = "parenttask", UserId = 1 }); obj.UpdateTask(T); int count1 = obj.GetTask().Count(); List <tblTask> TS1 = obj.GetTask(); Assert.AreEqual(count1, count); // Assert.AreEqual(T.TaskName, TS1[0].TaskName); }