Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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 TaskSubscriptions_TrySubscList_MarkOldRemindersRead()
 {
     TaskSubscriptionT.CreateTaskSubscription(_userNum, taskListChild.TaskListNum);           //Subscribed to TaskListChild (and by extension, TaskListGrandchild).
     #region Create Unread Past Due Reminders
     OpenDentBusiness.Task taskParent = TaskT.CreateTask(taskListParent.TaskListNum, descript: "ParentReminder", isUnread: true, reminderGroupId: "1"
                                                         , dateTimeEntry: DateTime.Now.AddSeconds(-1), reminderType: TaskReminderType.Once);
     OpenDentBusiness.Task taskChild = TaskT.CreateTask(taskListChild.TaskListNum, descript: "ChildReminder", isUnread: true, reminderGroupId: "1"
                                                        , dateTimeEntry: DateTime.Now.AddSeconds(-1), reminderType: TaskReminderType.Once);
     OpenDentBusiness.Task taskGrandchild = TaskT.CreateTask(taskListGrandchild.TaskListNum, descript: "GrandchildReminder", isUnread: true
                                                             , dateTimeEntry: DateTime.Now.AddSeconds(-1), reminderGroupId: "1", reminderType: TaskReminderType.Once);
     TaskAncestors.SynchAll();
     TaskUnreads.SetUnread(_userNum, taskParent);
     TaskUnreads.SetUnread(_userNum, taskChild);
     TaskUnreads.SetUnread(_userNum, taskGrandchild);
     #endregion
     bool isSuccess = TaskSubscriptions.TrySubscList(taskListParent.TaskListNum, _userNum);
     OpenDentBusiness.Task taskParentDb     = Tasks.GetOne(taskParent.TaskNum);
     OpenDentBusiness.Task taskChildDb      = Tasks.GetOne(taskChild.TaskNum);
     OpenDentBusiness.Task taskGrandchildDb = Tasks.GetOne(taskGrandchild.TaskNum);
     Assert.IsTrue(isSuccess);
     Assert.IsFalse(TaskUnreads.IsUnread(_userNum, taskParentDb));         //Only the task in taskListParent should be Read.
     Assert.IsTrue(TaskUnreads.IsUnread(_userNum, taskChildDb));           //The task in taskListChild should still be Unread.
     Assert.IsTrue(TaskUnreads.IsUnread(_userNum, taskGrandchildDb));      //The task in taskListGrandchild should still be Unread.
 }