square / mortar

A simple library that makes it easy to pair thin views with dedicated controllers, isolated from most of the vagaries of the Activity life cycle.
Apache License 2.0
2.16k stars 156 forks source link

Instrumentation Test in Mortar/Flow/Dagger 2 Project #182

Open giolin opened 8 years ago

giolin commented 8 years ago

Hello, I am currently using Mortar/Flow/Dagger 2 libraries to build an app. And I found it very hard (almost impossible) to mock the module when doing instrumentation test. I can inject my own test components to Application and Activity after they are created. However, for each Screen's dependencies, there is no way to inject my own components.

I would like to know if there is any possibility to mock the module for the Screen(s) and how I can actually achieve that.

Thank you!