示例#1
0
        public async void BreedsBySpeciesId_Not_Exists()
        {
            var mock = new ServiceMockFacade <ISpeciesService, ISpeciesRepository>();

            mock.RepositoryMock.Setup(x => x.BreedsBySpeciesId(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <Breed> >(new List <Breed>()));
            var service = new SpeciesService(mock.LoggerMock.Object,
                                             mock.MediatorMock.Object,
                                             mock.RepositoryMock.Object,
                                             mock.ModelValidatorMockFactory.SpeciesModelValidatorMock.Object,
                                             mock.DALMapperMockFactory.DALSpeciesMapperMock,
                                             mock.DALMapperMockFactory.DALBreedMapperMock);

            List <ApiBreedServerResponseModel> response = await service.BreedsBySpeciesId(default(int));

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