Blog.Logic.Core.Tests.PostContentsLogicTest.ShouldGetPostContentById C# (CSharp) Method

ShouldGetPostContentById() private method

private ShouldGetPostContentById ( ) : void
return void
        public void ShouldGetPostContentById()
        {
            var postContent = _postContents.FirstOrDefault(a => a.PostContentId == 1);
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Find(It.IsAny<Expression<Func<PostContent, bool>>>(), true))
                .Returns(new List<PostContent> { postContent });

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

            var content = _postContentsLogic.Get(1);

            Assert.AreEqual(1, content.Id);
        }