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

ShouldGetPostContentsByPost() private method

private ShouldGetPostContentsByPost ( ) : void
return void
        public void ShouldGetPostContentsByPost()
        {
            var postContents = _postContents.Where(a => a.PostId == 1).ToList();
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Find(It.IsAny<Expression<Func<PostContent, bool>>>(), true))
                .Returns(postContents);

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

            var contents = _postContentsLogic.GetByPostId(1);

            Assert.AreEqual(2, contents.Count);
            Assert.AreEqual(1, contents[0].PostId);
            Assert.AreEqual(1, contents[1].PostId);
        }