Blog.Logic.Core.Tests.CommentLikesLogicTest.ShouldDeleteCommentLikeWhenCommentLikedByUserAlready C# (CSharp) Метод

ShouldDeleteCommentLikeWhenCommentLikedByUserAlready() приватный Метод

private ShouldDeleteCommentLikeWhenCommentLikedByUserAlready ( ) : void
Результат void
        public void ShouldDeleteCommentLikeWhenCommentLikedByUserAlready()
        {
            var commentLike = _commentLikes.Where(a => a.CommentId == 1 && a.UserId == 1).ToList();
            _commentLikeRepository = new Mock<ICommentLikeRepository>();
            _commentLikeRepository.Setup(a => a.Find(It.IsAny<Expression<Func<CommentLike, bool>>>(), false))
                .Returns(commentLike);
            _commentLikeRepository.Setup(a => a.Delete(It.IsAny<CommentLike>()));

            _commentLikesLogic = new CommentLikesLogic(_commentLikeRepository.Object);

            var result = _commentLikesLogic.Add(new Common.Contracts.CommentLike
            {
                CommentId = 1,
                UserId = 1
            });

            Assert.Null(result);
        }