jvshahid/mock4go

A concern about your design

AlexLuya opened this issue · 1 comments

Base introduction,mock4go provided a way to mock part of functions of an instance,it looks like partial mocking in some java mocking framework,but this can be used to replace interface mocking.for example,A-->B-->C--->D,here,each arrow represents a dependency,If user wants to unit testing A,wih mock4go,he will need to create complete dependency graph due to there is no way to mock B completely.

I'm not sure i understand the problem here. If the goal is to unit test A then A should be initialized with a mocked version of B, which doesn't require initializing B's dependencies. What am i missing ?