Blog.Logic.Core.Tests.CommunityLogicTest.ShouldDeleteCommunity C# (CSharp) Method

ShouldDeleteCommunity() private method

private ShouldDeleteCommunity ( ) : void
return void
        public void ShouldDeleteCommunity()
        {
            var community = new Community { Id = 1, Name = "lorem", Description = "fudge brownies" };

            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.Delete(It.IsAny<Community>()));
            _communityRepository.Setup(a => a.Find(It.IsAny<Expression<Func<Community, bool>>>(), false))
                .Returns(new List<Community> { community });

            var logic = new CommunityLogic(_communityRepository.Object);
            var result = logic.Delete(1);

            Assert.IsTrue(result);
        }