public void SetupTest() { TaskListT.ClearTaskListTable(); TaskT.ClearTaskTable(); TaskSubscriptionT.ClearTaskSubscriptionTable(); SignalodT.ClearSignalodTable(); _taskListParent = TaskListT.CreateTaskList(descript: "TaskListParent"); _taskListChild = TaskListT.CreateTaskList(descript: "TaskListChild", parent: _taskListParent.TaskListNum, parentDesc: _taskListParent.Descript); _taskListGrandchild = TaskListT.CreateTaskList(descript: "TaskListGrandchild", parent: _taskListChild.TaskListNum, parentDesc: _taskListChild.Descript); _task = TaskT.CreateTask(_taskListGrandchild.TaskListNum, descript: "Test Task", fromNum: Security.CurUser.UserNum); //Starts in _taskListGrandchild Security.CurUser.TaskListInBox = _taskListParent.TaskListNum; //Set inbox for current user to _taskListParent. try { Userods.Update(Security.CurUser); } catch { Assert.Fail("Failed to update current user task list inbox."); //Error updating user. } _userControlTasksInstance = new UserControlTasks(); _userControlTasksAccessor = new PrivateObject(_userControlTasksInstance); //Artificially set that we are viewing _listTaskListParent. _userControlTasksAccessor.SetField("_listTaskListTreeHistory", new List <TaskList>() { _taskListParent }); _userControlTasksAccessor.SetField("_dictTaskLists", new Dictionary <long, TaskList>()); }
public static void TearDownClass() { TaskListT.ClearTaskListTable(); TaskT.ClearTaskTable(); TaskSubscriptionT.ClearTaskSubscriptionTable(); ClinicT.ClearClinicTable(); }
public void SetupTest() { TaskListT.ClearTaskListTable(); TaskT.ClearTaskTable(); TaskSubscriptionT.ClearTaskSubscriptionTable(); taskListParent = TaskListT.CreateTaskList(descript: "TaskList1"); taskListChild = TaskListT.CreateTaskList(descript: "TaskList1Child", parent: taskListParent.TaskListNum, parentDesc: taskListParent.Descript); taskListGrandchild = TaskListT.CreateTaskList(descript: "TaskList1Grandchild", parent: taskListChild.TaskListNum, parentDesc: taskListChild.Descript); }
public void TaskLists_RefreshMainTrunk_ClinicFilter() { string suffix = MethodBase.GetCurrentMethod().Name; TaskList taskListMainClinicFilter = TaskListT.CreateTaskList(descript: "Main Clinic Filter", parent: 0, globalTaskFilterType: GlobalTaskFilterType.Clinic); TaskSubscriptions.TrySubscList(taskListMainClinicFilter.TaskListNum, _userA.UserNum); //Add clinicS appointment and patient Tasks. CreateTasks(suffix, _patS, _userA, taskListMainClinicFilter.TaskListNum); //Hashtag No filter List <TaskList> listTaskListsActual = TaskLists.RefreshMainTrunk(_userA.UserNum, TaskType.All, _clinicN.ClinicNum, _clinicN.Region); TaskList taskListMain = listTaskListsActual.FirstOrDefault(x => x.TaskListNum == taskListMainClinicFilter.TaskListNum); Assert.IsTrue(taskListMain != null && taskListMain.NewTaskCount == 1); }
public void TaskLists_RefreshDatedTrunk_NoFilter() { string suffix = MethodBase.GetCurrentMethod().Name; TaskList taskListNoFilter = TaskListT.CreateTaskList(descript: "No Filter", parent: _taskListMainNoFilter.TaskListNum, globalTaskFilterType: GlobalTaskFilterType.None); //Add clinicS appointment and patient Tasks. CreateTasks(suffix, _patN, _userA, taskListNoFilter.TaskListNum); //Hashtag No filter List <TaskList> listTaskListsActual = TaskLists.RefreshDatedTrunk(DateTime.Today, TaskDateType.None, _userA.UserNum , _clinicN.ClinicNum, _clinicN.Region); TaskList taskList = listTaskListsActual.FirstOrDefault(x => x.TaskListNum == taskListNoFilter.TaskListNum); Assert.IsTrue(taskList != null && taskList.NewTaskCount == 3); }
public void TaskLists_RefreshRepeating_RegionFilterClinicRestriction() { string suffix = MethodBase.GetCurrentMethod().Name; TaskList taskListRegion = TaskListT.CreateTaskList(descript: "Region Filter", parent: _taskListMainNoFilter.TaskListNum, globalTaskFilterType: GlobalTaskFilterType.Region , isRepeating: true); //Add clinicS appointment and patient Tasks. CreateTasks(suffix, _patN, _userA, taskListRegion.TaskListNum); //Hashtag No filter List <TaskList> listTaskListsActual = TaskLists.RefreshRepeating(TaskDateType.None, _userNW.UserNum, _clinicNW.ClinicNum, _clinicNW.Region); TaskList taskList = listTaskListsActual.FirstOrDefault(x => x.TaskListNum == taskListRegion.TaskListNum); Assert.IsTrue(taskList != null && taskList.NewTaskCount == 1); }
public void TaskLists_RefreshRepeatingTrunk_ClinicFilter() { string suffix = MethodBase.GetCurrentMethod().Name; TaskList taskListClinic = TaskListT.CreateTaskList(descript: "Clinic Filter", parent: 0, globalTaskFilterType: GlobalTaskFilterType.Clinic , isRepeating: true); //Add clinicS appointment and patient Tasks. CreateTasks(suffix, _patS, _userA, taskListClinic.TaskListNum); //Hashtag No filter List <TaskList> listTaskListsActual = TaskLists.RefreshRepeatingTrunk(_userA.UserNum, _clinicN.ClinicNum, _clinicN.Region); TaskList taskList = listTaskListsActual.FirstOrDefault(x => x.TaskListNum == taskListClinic.TaskListNum); Assert.IsTrue(taskList != null && taskList.NewTaskCount == 1); }
public void SetupTest() { PrefT.UpdateBool(PrefName.EasyNoClinics, false); PrefT.UpdateInt(PrefName.TasksGlobalFilterType, (int)GlobalTaskFilterType.None); TaskListT.ClearTaskListTable(); TaskT.ClearTaskTable(); TaskSubscriptionT.ClearTaskSubscriptionTable(); _taskListMainNoFilter = TaskListT.CreateTaskList(descript: "No Filter", parent: 0, globalTaskFilterType: GlobalTaskFilterType.None); _taskListClinic = TaskListT.CreateTaskList(descript: "Clinic Filter", parent: _taskListMainNoFilter.TaskListNum, globalTaskFilterType: GlobalTaskFilterType.Clinic); _taskListRegion = TaskListT.CreateTaskList(descript: "Region Filter", parent: _taskListMainNoFilter.TaskListNum, globalTaskFilterType: GlobalTaskFilterType.Region); _taskListRepeating = TaskListT.CreateTaskList("Repeating", isRepeating: true); TaskSubscriptions.TrySubscList(_taskListMainNoFilter.TaskListNum, _userA.UserNum); TaskSubscriptions.TrySubscList(_taskListClinic.TaskListNum, _userA.UserNum); TaskSubscriptions.TrySubscList(_taskListRegion.TaskListNum, _userA.UserNum); TaskSubscriptions.TrySubscList(_taskListRegion.TaskListNum, _userNW.UserNum); }
public void SetupTest() { TaskListT.ClearTaskListTable(); TaskT.ClearTaskTable(); TaskSubscriptionT.ClearTaskSubscriptionTable(); SignalodT.ClearSignalodTable(); _taskListParent = TaskListT.CreateTaskList(descript: "TaskListParent"); _taskListChild = TaskListT.CreateTaskList(descript: "TaskListChild", parent: _taskListParent.TaskListNum, parentDesc: _taskListParent.Descript); _taskListGrandchild = TaskListT.CreateTaskList(descript: "TaskListGrandchild", parent: _taskListChild.TaskListNum, parentDesc: _taskListChild.Descript); _task = TaskT.CreateTask(_taskListGrandchild.TaskListNum, descript: "Test Task", fromNum: Security.CurUser.UserNum, priorityDefNum: 1); //Starts in _taskListGrandchild TaskSubscriptionT.CreateTaskSubscription(Security.CurUser.UserNum, _taskListParent.TaskListNum); //current user subscribes to top level tasklist. Security.CurUser.TaskListInBox = _taskListParent.TaskListNum; //Set inbox for current user to _taskListParent. try { Userods.Update(Security.CurUser); Userods.RefreshCache(); } catch { Assert.Fail("Failed to update current user task list inbox."); //Error updating user. } _formTaskEditInstance = new FormTaskEdit(_task); _formTaskEditAccessor = new PrivateObject(_formTaskEditInstance); _formTaskEditAccessor.Invoke("LoadTask"); }