public void Should_Remove_Watcher_From_Issue() { redmineManager.RemoveWatcherFromIssue(WATCHER_ISSUE_ID, WATCHER_USER_ID); Issue issue = redmineManager.GetObject <Issue>(WATCHER_ISSUE_ID.ToString(), new NameValueCollection { { RedmineKeys.INCLUDE, RedmineKeys.WATCHERS } }); Assert.IsNotNull(issue, "Issue is null."); Assert.IsTrue(issue.Watchers == null || ((List <Watcher>)issue.Watchers).Find(w => w.Id == WATCHER_USER_ID) == null, "Watcher was not removed."); }
/// <summary> /// Removes the watcher from issue asynchronous. /// </summary> /// <param name="redmineManager">The redmine manager.</param> /// <param name="issueId">The issue identifier.</param> /// <param name="userId">The user identifier.</param> /// <returns></returns> public static Task RemoveWatcherFromIssueAsync(this RedmineManager redmineManager, int issueId, int userId) { return(Task.Factory.StartNew(() => redmineManager.RemoveWatcherFromIssue(issueId, userId), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)); }
/// <summary> /// Removes the watcher from issue asynchronous. /// </summary> /// <param name="redmineManager">The redmine manager.</param> /// <param name="issueId">The issue identifier.</param> /// <param name="userId">The user identifier.</param> /// <returns></returns> public static Task RemoveWatcherFromIssueAsync(this RedmineManager redmineManager, int issueId, int userId) { return(delegate { redmineManager.RemoveWatcherFromIssue(issueId, userId); }); }
/// <summary> /// Removes the watcher from issue asynchronous. /// </summary> /// <param name="redmineManager">The redmine manager.</param> /// <param name="issueId">The issue identifier.</param> /// <param name="userId">The user identifier.</param> /// <returns></returns> public static Task RemoveWatcherFromIssueAsync(this RedmineManager redmineManager, int issueId, int userId) { return(Task.Factory.StartNew(() => redmineManager.RemoveWatcherFromIssue(issueId, userId), TaskCreationOptions.LongRunning)); }