public User AddGroup([FromUri] int userId, [FromUri] int groupId) { var user = Get(userId); var group = groupBusinessLogic.Get(groupId); user = userBusinessLogic.AddGroup(user, group); return(user); }
public void UserAlreadyInGroup() { // Arrange var user = new User(UserId: 1, Username: "******", Password: "******", "", "", DateTime.Now, "", "", ""); var group = new Group() { GroupId = 1, GroupName = "Group 1" }; groupRepository.Add(group); userRepository.Add(user); // Act userBusinessLogic.AddGroup(user, group); userBusinessLogic.AddGroup(user, group); // Assert // ExpectedException }