I am struggling with mocking the `foo` and `bar` i...
# mockk
j
I am struggling with mocking the
foo
and
bar
in this example. The code in the snippet is not working. I also tried making use of
mockkConstructor()
function for the
ServiceLocator()
,
Foo()
and
Bar()
, which also didn’t work. So my question is; how can I set up the mocks correctly so that I can test
MyClass
without going out of the class.
w
Isn't the case where you are creating the
MyClass
before mocking the
ServiceLocator
object?
j
🤯
You are right.