Beispiel #1
0
        public async Task Should_Add_Watcher_To_Issue()
        {
            await redmineManager.AddWatcherAsync(watcherIssueId, watcherUserId);

            Issue issue = await redmineManager.GetObjectAsync <Issue>(watcherIssueId.ToString(), new NameValueCollection { { "include", "watchers" } });

            Assert.IsNotNull(issue, "Get issue returned null.");
            Assert.IsTrue(issue.Watchers.Count == 1, "Number of watchers != 1");
            CollectionAssert.AllItemsAreNotNull(issue.Watchers.ToList(), "Watchers contains null items.");
            CollectionAssert.AllItemsAreUnique(issue.Watchers.ToList(), "Watcher items are not unique.");
            Assert.IsTrue(((List <Watcher>)issue.Watchers).Find(w => w.Id == watcherUserId) != null, "Watcher not added to issue.");
        }