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

ShouldUpdateCommunity() private method

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

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

            var logic = new CommunityLogic(_communityRepository.Object);
            var result = logic.Update(new Common.Contracts.Community
            {
                Id = 1,
                Name = "lorem",
                Description = "fudge brownies"
            });

            Assert.NotNull(result);
            Assert.IsNull(result.Error);
        }