public ActionResult <ICollection <CommentDTO> > GetCommentsOfEncounter(int encounterId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var comments = mapper.Map <CommentDTO[]>(commentBusinessLogic.GetAllCommentsOfEncounter(encounterId)); return(Ok(comments)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public void GetAllCommentsOfEncounterTest() { var comments = commentBL.GetAllCommentsOfEncounter(1); mockCommentRepo.Verify(x => x.Get(It.IsAny <Expression <Func <Comment, bool> > >(), null, ""), Times.Once()); }