public void Should_Delete_User_From_Group() { redmineManager.RemoveUserFromGroup(GROUP_ID, int.Parse(USER_ID)); User user = redmineManager.GetObject <User>(USER_ID.ToString(), new NameValueCollection { { RedmineKeys.INCLUDE, RedmineKeys.GROUPS } }); Assert.IsNotNull(user, "User object is null."); Assert.IsTrue(user.Groups == null || user.Groups.Find(g => g.Id == GROUP_ID) == null, "User was not removed from group."); }
/// <summary> /// Removes the user from 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 RemoveUserFromGroupAsync(this RedmineManager redmineManager, int groupId, int userId) { return(Task.Factory.StartNew(() => redmineManager.RemoveUserFromGroup(groupId, userId), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)); }
/// <summary> /// Removes the user from 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 RemoveUserFromGroupAsync(this RedmineManager redmineManager, int groupId, int userId) { return(delegate { redmineManager.RemoveUserFromGroup(groupId, userId); }); }
/// <summary> /// Removes the user from 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 RemoveUserFromGroupAsync(this RedmineManager redmineManager, int groupId, int userId) { return(Task.Factory.StartNew(() => redmineManager.RemoveUserFromGroup(groupId, userId), TaskCreationOptions.LongRunning)); }
/// <summary> /// Removes the user from 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 RemoveUserFromGroupAsync(this RedmineManager redmineManager, int groupId, int userId) { return(Task.Factory.StartNew(() => redmineManager.RemoveUserFromGroup(groupId, userId))); }