public async void All_ShouldReturnRecords() { var mock = new ServiceMockFacade <ISpeciesService, ISpeciesRepository>(); var records = new List <Species>(); records.Add(new Species()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(records)); var service = new SpeciesService(mock.LoggerMock.Object, mock.MediatorMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.SpeciesModelValidatorMock.Object, mock.DALMapperMockFactory.DALSpeciesMapperMock, mock.DALMapperMockFactory.DALBreedMapperMock); List <ApiSpeciesServerResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())); }