4 ms·
I use them for testing, where I can have a client that is called by the code under test and can either just run a test CB, send a REST call to a remote server,
by lanstin 1y ago
I use them for testing, where I can have a client that is called by the code under test and can either just run a test CB, send a REST call to a remote server, send a gRPC call to a remote server, or make a function call to an in-process gRPC server object.
- __turbobrew__ 1y agoYea, mocking is generally the most use I get out of interfaces
- dgb23 1y agoPlain data is really convenient for testing though. I think the reason that your example is so useful is not generally because of testing, but because the thing you're interacting with has operational semantics. It's a good use case for object orientation, so interfaces and mocking are the natural way of testing your logic.