grpc/grpc-swift

Client Mock

zxqqingchuan opened this issue · 2 comments

Can I mock client response without service providers.

For exmaple: client.get(request).return(response).withSuccess(). Here response is mocked response. I hope to mock or test client code without generate providers in .grpc. Because I hope not import service codes in .grpc.

No, this isn't possible I'm afraid. Your best bet is to implement a mock provider where you can inject responses rather then the running the actual service.