public void GetAllTasks() { var db = new mitoden_dbgr13Entities(); var ser = new Service1(); var tasksProcedure = new List<TaskDTO>(); tasksProcedure = ser.GetAllTasks(); var tasksEntityFramework = db.Task.ToList(); Assert.AreEqual(tasksProcedure.Count, tasksEntityFramework.Count); }
public void UpdateTaskStatus() { var db = new mitoden_dbgr13Entities(); var ser = new Service1(); ser.CreateTask("Unit Test", "norb0102", 1, DateTime.Now); var taskcreated = db.Task.LastOrDefault(); ser.UpdateTaskStatus(taskcreated.TaskID, "Testing"); var task = db.Task.Where(m => m.Feedback == "Testing").FirstOrDefault(); Assert.AreEqual(task.TaskID, taskcreated.TaskID); }
public void GetAllTasksFromWorker() { var db = new mitoden_dbgr13Entities(); var ser = new Service1(); var tasksProcedure = new List<TaskDTO>(); tasksProcedure = ser.GetAllTasksFromWorker("hohn"); var tasksEntityFramework = db.Task.Where(m => m.FK_Username == "hohn").ToList(); Assert.AreEqual(tasksProcedure[0].TaskID, tasksEntityFramework[0].TaskID); Assert.AreEqual(tasksProcedure.Count, tasksEntityFramework.Count); }