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 AddTask() { ProjectBAL obje = new ProjectBAL(); int count = obje.GetTask().Count(); //dynamic testtask = new (Task) list<Task>; tblTask T = (new tblTask { TaskName = "Testtaskname", TStartDate = DateTime.Now, TEndDate = DateTime.Now, TPriority = 10, TStatus = false, ParentTaskName = "parenttask", UserId = 1 }); obje.AddTask(T); int count1 = obje.GetTask().Count(); Assert.AreEqual(count1, count + 1); }
public void Getall() { ProjectBAL obj = new ProjectBAL(); int count = obj.GetTask().Count(); Assert.Greater(count, 0); }
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); }
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() { ProjectBAL obj = new ProjectBAL(); return(Ok(obj.GetTask())); }