Blog.Logic.Core.Tests.CommunityLogicTest.ShouldReturnErrorWhenGetCommunityIdFoundNoRecords C# (CSharp) 메소드

ShouldReturnErrorWhenGetCommunityIdFoundNoRecords() 개인적인 메소드

private ShouldReturnErrorWhenGetCommunityIdFoundNoRecords ( ) : void
리턴 void
        public void ShouldReturnErrorWhenGetCommunityIdFoundNoRecords()
        {
            _communityRepository = new Mock<ICommunityRepository>();
            _communityRepository.Setup(a => a.Get(It.IsAny<int>())).Returns((Community)null);

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

            Assert.NotNull(result.Error);
            Assert.AreEqual((int)Constants.Error.RecordNotFound, result.Error.Id);
            Assert.AreEqual("Cannot find community with Id 1", result.Error.Message);
        }