Esempio n. 1
0
        public void CreateAsync_WhenCommentNull_ThrowArgumentNullException()
        {
            WrikeFolderComment newComment = null;
            var ex = Assert.ThrowsAsync <ArgumentNullException>(() => TestConstants.WrikeClient.Comments.CreateAsync(newComment));

            Assert.AreEqual("newComment", ex.ParamName);
        }
        public void CreateAsync_ShouldAddNewNewCommentToDefaultFolder()
        {
            var newComment = new WrikeFolderComment("My new test comment", DefaultFolderId);

            var createdComment = WrikeClientFactory.GetWrikeClient().Comments.CreateAsync(newComment, plainText: true).Result;

            Assert.IsNotNull(createdComment);
            Assert.AreEqual(newComment.Text, createdComment.Text);
            Assert.AreEqual(newComment.FolderId, createdComment.FolderId);
        }
        public void GetInFolderAsync_ShouldReturnComments()
        {
            var newComment     = new WrikeFolderComment("My new test comment", DefaultFolderId);
            var createdComment = WrikeClientFactory.GetWrikeClient().Comments.CreateAsync(newComment, plainText: true).Result;

            var comments = WrikeClientFactory.GetWrikeClient().Comments.GetInFolderAsync(DefaultFolderId).Result;

            Assert.IsNotNull(comments);
            Assert.Greater(comments.Count, 0);
            Assert.IsTrue(comments.Any(c => c.Id == createdComment.Id));
        }