Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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
        }