public void Test_AddCommentToGame_Body_Is_Null()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);
            CommentDTO comment = new CommentDTO() { ParentCommentId = 2, Body = null, Name = "Autor2" };
            GameDTO game = new GameDTO() { Key = "me3" };

            //act
            servise.AddCommentToGame(comment, game);
        }
        public void Test_AddCommentToGame_Comment_Is_Null()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.AddCommentToGame(null, new GameDTO());
        }
        public void Test_DeleteComment_Id_Less_Zero()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(-1);
        }
        public void Test_DeleteComment_Call_Update_IsDeleted_True()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(2);

            //assert
            _comments.Verify(c => c.Update(It.Is<Comment>(comment => comment.IsDeleted)), Times.Once());
        }
        public void Test_DeleteComment_Call_Delete()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            servise.DeleteComment(1);

            //assert
            _comments.Verify( c => c.Delete(It.IsAny<Comment>()), Times.Once () );
        }
        public void Test_CommentsAttachedToGame_Return_Right_Object()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            List<CommentDTO> commentsList = servise.CommentsAttachedToGame("me3").ToList ();

            //assert
            Assert.AreEqual(3, commentsList.Count);
            Assert.AreEqual(0, commentsList[0].CommentId);
            Assert.AreEqual(1, commentsList[1].CommentId);
            Assert.AreEqual(2, commentsList[2].CommentId);
        }
        public void Test_CommentsAttachedToGame_Key_Is_Null()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);

            //act
            IEnumerable<CommentDTO> commentsList = servise.CommentsAttachedToGame(null);
        }
        public void Test_AddCommentToGame_With_ParrentId()
        {
            //arrange
            CommentService servise = new CommentService(_unitOfWork.Object);
            CommentDTO comment = new CommentDTO() { ParentCommentId = 2, Body = "Text4", Name = "Autor2" };
            GameDTO game = new GameDTO() { Key = "me3" };

            //act
            servise.AddCommentToGame(comment, game);

            //assert
            _comments.Verify(c => c.Insert(It.IsAny<Comment>()), Times.Once());
        }