public async void All() { var mock = new ServiceMockFacade <IIllustrationRepository>(); var records = new List <Illustration>(); records.Add(new Illustration()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records)); var service = new IllustrationService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.IllustrationModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLIllustrationMapperMock, mock.DALMapperMockFactory.DALIllustrationMapperMock); List <ApiIllustrationResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>())); }