public void CanAnCommentBeUpdated()
        {
            var     maxid = _testRepo.FindAll().Min(m => m.commentid);
            Comment a     = new Comment()
            {
                commentid = maxid,
                shorttext = "Some image from test",
                body      = "Some Name from test",
                userid    = 1,
                contentid = 1
            };

            _testRepo.Update(a);

            var updatedComment = _testRepo.FindByID(maxid);

            Assert.AreEqual(a.shorttext, updatedComment.shorttext);
        }
示例#2
0
 public IActionResult GetComments(int id)
 {
     return(Ok(CommentRepo.FindByID(id)));
 }