Closed RoRoche closed 7 years ago
I have pushed a new version to support Dagger Android (you can try it using version 0.7.1-beta1). You must add an invocation to method customizeBuilder
to set the application, an example is available here.
In this version Dagger Android is supported in Espresso test to replace objects defined in Application component, I'll continue to investigate to find a way to support it in JUnit tests and for subcomponents and dependent components.
Awesome! It works like a charm. Thanks a lot.
Here is my main component:
Here is my
Application
subclass:And here is my
DaggerMockRule
subclass:When launching my test, I reach the following exception:
because of the
IllegalStateException
thrown by the Dagger2's generated code as follows: