public void UserWithOneLevelChilds() { var childs = UserHierarchyInfoProvider.GetAllChilds(1, 12).ToList(); Assert.AreEqual(3, childs.Count()); Assert.Contains(14, childs); Assert.Contains(15, childs); Assert.Contains(16, childs); }
public void UserWithMultipleLevelChilds() { var childs = UserHierarchyInfoProvider.GetAllChilds(1, 7).ToList(); Assert.AreEqual(11, childs.Count()); Assert.Contains(11, childs); Assert.Contains(12, childs); Assert.Contains(13, childs); Assert.Contains(14, childs); Assert.Contains(15, childs); Assert.Contains(16, childs); Assert.Contains(2, childs); Assert.Contains(4, childs); Assert.Contains(5, childs); Assert.Contains(9, childs); Assert.Contains(10, childs); }
public void UserWithCycledChilds() { var childs = UserHierarchyInfoProvider.GetAllChilds(1, 5).ToList(); Assert.AreEqual(4, childs.Count()); if (childs.Count() > 0) { var grouped = childs.GroupBy(v => v, v => v).Where(s => s.Count() > 1); Assert.AreEqual(0, grouped.Count()); } else { Assert.Fail(); } Assert.Contains(9, childs); Assert.Contains(10, childs); Assert.Contains(2, childs); Assert.Contains(4, childs); }
public void UserWithoutChilds() { var childs = UserHierarchyInfoProvider.GetAllChilds(1, 8); Assert.IsEmpty(childs); }
public void NonNullResult() { var childs = UserHierarchyInfoProvider.GetAllChilds(2, 1); Assert.IsNotNull(childs); }