Exemplo n.º 1
0
 public UpdateCommentRequest Update(UpdateCommentDto comment)
 {
     return new UpdateCommentRequest(m_clientService, comment);
 }
Exemplo n.º 2
0
        public void Update_comment_Should_update_comment(
            string id, string text, string userId,
            string expectedDate, string expectedPostedDate, string expectedDepartmentId)
        {
            var updateCommentDto = new UpdateCommentDto
            {
                Id = id,
                Text = text,
                UserId = userId
            };
            var commentId = Api.Comments.Update(updateCommentDto).Fetch().Result;

            Assert.That(commentId, Is.EqualTo(id));
            var comment = Api.Comments.Get(commentId).Fetch().Result;
            Assert.That(comment.Text, Is.EqualTo(text));
            Assert.That(comment.PeriodDate, Is.EqualTo(expectedDate));
            Assert.That(comment.PostedDate, Is.EqualTo(expectedPostedDate));
            Assert.That(comment.LastUpdatedDate, Is.StringStarting(DateTime.Today.ToShortDateString()));
            Assert.That(comment.UserId, Is.EqualTo(userId));
            Assert.That(comment.DepartmentId, Is.EqualTo(expectedDepartmentId));
        }