Blog.Logic.Core.Tests.CommentsLogicTest.ShouldGetCommentById C# (CSharp) Method

ShouldGetCommentById() private method

private ShouldGetCommentById ( ) : void
return void
        public void ShouldGetCommentById()
        {
            var expected = _comments.Where(a => a.CommentId == 1).ToList();
            _commentsRepository = new Mock<ICommentRepository>();
            _commentsRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Comment, bool>>>(),
                It.IsAny<Func<IQueryable<Comment>, IOrderedQueryable<Comment>>>(), It.IsAny<string>()))
                .Returns(expected);

            _userRepository = new Mock<IUserRepository>();

            _commentsLogic = new CommentsLogic(_commentsRepository.Object, _userRepository.Object);

            var result = _commentsLogic.Get(1);

            Assert.NotNull(result);
            Assert.IsInstanceOf(typeof(Common.Contracts.Comment), result);
        }