public void deleteMemberUserGroup() { User user = new User("user_test" + rnd.Next(100000), true); Group group = new Group("group_test" + rnd.Next(100000), true); user = AMUserHelpers.createUser(user); group = AMGroupHelpers.createGroup(group); AMMembershipsHelpers.addMemberUserGroups(user.Id, new string[] { group.Id }); AMMembershipsHelpers.deleteMemberUserGroups(user.Id, new string[] { group.Id }); Assert.IsFalse(AMMembershipsHelpers.checkMemberUserGroup(group.Id, user.Id), "Пользователь " + user.Id + " не удален из группы " + group.Id); AMGroupHelpers.deleteGroup(group.Id); AMUserHelpers.deleteUser(user.Id); }
public void addMemberUserFewGroups() { User user = new User("user_test" + rnd.Next(100000), true); Group group = new Group("group_test" + rnd.Next(100000), true); Group group2 = new Group("group_test" + rnd.Next(100000), true); user = AMUserHelpers.createUser(user); group = AMGroupHelpers.createGroup(group); group2 = AMGroupHelpers.createGroup(group2); AMMembershipsHelpers.addMemberUserGroups(user.Id, new string[] { group.Id, group2.Id }); Assert.IsTrue(AMMembershipsHelpers.checkMemberUserGroup(group.Id, user.Id), "Пользователя " + user.Id + " нет в группе " + group.Id); Assert.IsTrue(AMMembershipsHelpers.checkMemberUserGroup(group2.Id, user.Id), "Пользователя " + user.Id + " нет в группе " + group2.Id); AMGroupHelpers.deleteGroup(group.Id); AMUserHelpers.deleteUser(user.Id); AMGroupHelpers.deleteGroup(group2.Id); }