public ActionResult <ICollection <CommentDTO> > GetAllComments()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var comments = mapper.Map <CommentDTO[]>(commentBusinessLogic.GetAll());
                return(Ok(comments));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
Пример #2
0
        public void GetAllCommentsTest()
        {
            var comments = commentBL.GetAll();

            mockCommentRepo.Verify(x => x.Get(null, null, ""), Times.Once());
        }