Esempio n. 1
0
        public void Should_Add_User_To_Group()
        {
            redmineManager.AddUserToGroup(GROUP_ID, int.Parse(USER_ID));

            User user = redmineManager.GetObject <User>(USER_ID.ToString(), new NameValueCollection {
                { RedmineKeys.INCLUDE, RedmineKeys.GROUPS }
            });

            Assert.IsNotNull(user, "User is null.");
            Assert.IsNotNull(user.Groups, "Groups list is null.");
            Assert.IsTrue(user.Groups.Find(g => g.Id == GROUP_ID) != null, "User was not added to group.");
        }
Esempio n. 2
0
 /// <summary>
 /// Adds the user to group asynchronous.
 /// </summary>
 /// <param name="redmineManager">The redmine manager.</param>
 /// <param name="groupId">The group identifier.</param>
 /// <param name="userId">The user identifier.</param>
 /// <returns></returns>
 public static Task AddUserToGroupAsync(this RedmineManager redmineManager, int groupId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddUserToGroup(groupId, userId), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default));
 }
 /// <summary>
 /// Adds the user to group asynchronous.
 /// </summary>
 /// <param name="redmineManager">The redmine manager.</param>
 /// <param name="groupId">The group identifier.</param>
 /// <param name="userId">The user identifier.</param>
 /// <returns></returns>
 public static Task AddUserToGroupAsync(this RedmineManager redmineManager, int groupId, int userId)
 {
     return(delegate { redmineManager.AddUserToGroup(groupId, userId); });
 }
Esempio n. 4
0
 /// <summary>
 /// Adds the user to group asynchronous.
 /// </summary>
 /// <param name="redmineManager">The redmine manager.</param>
 /// <param name="groupId">The group identifier.</param>
 /// <param name="userId">The user identifier.</param>
 /// <returns></returns>
 public static Task AddUserToGroupAsync(this RedmineManager redmineManager, int groupId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddUserToGroup(groupId, userId), TaskCreationOptions.LongRunning));
 }
 /// <summary>
 /// Adds the user to group asynchronous.
 /// </summary>
 /// <param name="redmineManager">The redmine manager.</param>
 /// <param name="groupId">The group identifier.</param>
 /// <param name="userId">The user identifier.</param>
 /// <returns></returns>
 public static Task AddUserToGroupAsync(this RedmineManager redmineManager, int groupId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddUserToGroup(groupId, userId)));
 }