Comment by UK-Al05
14 days ago
You have to mock/fake when modules call dependencies.
Your way means you only ever have siblings. With an orchestrator pulling results out of one module and pushing it into another.
14 days ago
You have to mock/fake when modules call dependencies.
Your way means you only ever have siblings. With an orchestrator pulling results out of one module and pushing it into another.
Code that uses hexagonal architecture/dependency inversion requires less mocks in their tests.
That’s… not true? No matter how you define your dependencies to inject, if you want to mock the dependencies you inject you have to mock them (it’s almost tautological), no matter if you use dependency inversion or not
Maybe you mean "less surface to mock", which is irrelevant if you generate your mocks automatically from the interface
> We can say that a Mock is a kind of spy, a spy is a kind of stub, and a stub is a kind of dummy. But a fake isn’t a kind of any of them. It’s a completely different kind of test double.
You define fakes in this case, not mocks https://blog.cleancoder.com/uncle-bob/2014/05/14/TheLittleMo...
2 replies →
I use that architecture. You still use mocks at the edges.