예제 #1
0
        public void Should_Add_Watcher_To_Issue()
        {
            redmineManager.AddWatcherToIssue(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.IsNotNull(issue.Watchers, "Watchers list is null.");
            Assert.IsTrue(((List <Watcher>)issue.Watchers).Find(w => w.Id == WATCHER_USER_ID) != null, "Watcher was not added.");
        }
예제 #2
0
 /// <summary>
 /// Adds the watcher to 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 AddWatcherToIssueAsync(this RedmineManager redmineManager, int issueId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddWatcherToIssue(issueId, userId), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default));
 }
 /// <summary>
 /// Adds the watcher to 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 AddWatcherToIssueAsync(this RedmineManager redmineManager, int issueId, int userId)
 {
     return(delegate { redmineManager.AddWatcherToIssue(issueId, userId); });
 }
예제 #4
0
 /// <summary>
 /// Adds the watcher to 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 AddWatcherToIssueAsync(this RedmineManager redmineManager, int issueId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddWatcherToIssue(issueId, userId), TaskCreationOptions.LongRunning));
 }
 /// <summary>
 /// Adds the watcher to 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 AddWatcherToIssueAsync(this RedmineManager redmineManager, int issueId, int userId)
 {
     return(Task.Factory.StartNew(() => redmineManager.AddWatcherToIssue(issueId, userId)));
 }