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

ShouldGetCommunityId() private method

private ShouldGetCommunityId ( ) : void
return void
        public void ShouldGetCommunityId()
        {
            var communitySearch = new Community
                                  {
                                      Id = 1,
                                      LeaderUserId = 1,
                                      Leader = _members.FirstOrDefault(a => a.UserId == 1),
                                      Members = _members.ToList(),
                                      Posts = new List<Post> { new Post { PostId = 1 } }
                                  };

            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.Get(It.IsAny<int>())).Returns(communitySearch);
            _communityRepository.Setup(a => a.GetMemberCountByCommunity(It.IsAny<int>())).Returns(5);

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

            Assert.NotNull(result);
            Assert.NotNull(result.Posts);
            Assert.IsNull(result.Error);
            Assert.AreEqual(5, result.MemberCount);
        }