コード例 #1
0
        public async void ByFollowingUserId_Not_Exists()
        {
            var mock = new ServiceMockFacade <IFollowerRepository>();

            mock.RepositoryMock.Setup(x => x.ByFollowingUserId(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <Follower> >(new List <Follower>()));
            var service = new FollowerService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.FollowerModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLFollowerMapperMock,
                                              mock.DALMapperMockFactory.DALFollowerMapperMock);

            List <ApiFollowerResponseModel> response = await service.ByFollowingUserId(default(int));

            response.Should().BeEmpty();
            mock.RepositoryMock.Verify(x => x.ByFollowingUserId(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>()));
        }