public void TaskSubscriptions_GetSubscribedTaskLists_SubscribedToParent() { TaskSubscriptionT.CreateTaskSubscription(_userNum, taskListParent.TaskListNum); List <TaskSubscription> listTaskSubs = TaskSubscriptions.GetTaskSubscriptionsForUser(_userNum); Assert.AreEqual(1, listTaskSubs.Count); Assert.IsTrue(listTaskSubs.Any(x => x.TaskListNum == taskListParent.TaskListNum)); //parent }
public void TaskSubscriptions_GetSubscribedTaskLists_SubscribedToGrandchildOnlyl() { TaskSubscriptionT.CreateTaskSubscription(_userNum, taskListGrandchild.TaskListNum); List <TaskSubscription> listTaskSubs = TaskSubscriptions.GetTaskSubscriptionsForUser(_userNum); Assert.AreEqual(1, listTaskSubs.Count); Assert.IsFalse(listTaskSubs.Any(x => x.TaskListNum == taskListParent.TaskListNum)); //not parent Assert.IsFalse(listTaskSubs.Any(x => x.TaskListNum == taskListChild.TaskListNum)); //not child Assert.IsTrue(listTaskSubs.Any(x => x.TaskListNum == taskListGrandchild.TaskListNum)); //grandchild }