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 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"); }