In the example that’s a fair point, I might have over simplified in what I wrote.
In many cases that is preferred yes.
To expand a bit.
- For unit tests, to your point if you have tested each adapter independently, when you test the Adapter itself you can take any implementation, because you’re primarily focused on responding to what the behaviour can return
- For integration tests I don’t think it’s as straight forward at a certain point of complexity. In one of the packages I’m working on it is the difference between Redis and Postgres and to test an important scenario there are many interactions with the adapter, and while the responses will match the contract, the expected behaviours might not. I’m not sure how you would test them in isolation while having confidence that the scenarios are going to be correct.
I hope that makes sense?


















