public async void All() { var mock = new ServiceMockFacade <IDestinationRepository>(); var records = new List <Destination>(); records.Add(new Destination()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records)); var service = new DestinationService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.DestinationModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLDestinationMapperMock, mock.DALMapperMockFactory.DALDestinationMapperMock); List <ApiDestinationResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>())); }