public async void All() { var mock = new ServiceMockFacade<ITenantRepository>(); var records = new List<Tenant>(); records.Add(new Tenant()); mock.RepositoryMock.Setup(x => x.All(It.IsAny<int>(), It.IsAny<int>())).Returns(Task.FromResult(records)); var service = new TenantService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.TenantModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLTenantMapperMock, mock.DALMapperMockFactory.DALTenantMapperMock); List<ApiTenantResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny<int>(), It.IsAny<int>())); }