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

ShouldAddPostContent() private method

private ShouldAddPostContent ( ) : void
return void
        public void ShouldAddPostContent()
        {
            var dbResult = new PostContent
            {
                PostContentId = 4,
                PostContentTitle = "Foo",
                PostContentText = "Lorem Ipsum Dolor",
                PostId = 2
            };
            _postContentRepository = new Mock<IPostContentRepository>();
            _postContentRepository.Setup(a => a.Add(It.IsAny<PostContent>())).Returns(dbResult);

            _postContentsLogic = new PostContentsLogic(_postContentRepository.Object);

            var result = _postContentsLogic.Add(new Common.Contracts.PostContent
            {
                Id = 4,
                PostContentTitle = "Foo",
                PostContentText = "Lorem Ipsum Dolor",
                PostId = 5
            });

            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.PostId);
        }