Issue
I'm a beginner in android tests and what I would like to know is very simple. I have a button which launch an activity on click and instead of launching the real activity I would like to replace it by the launch of another one. How can I achieve that? I'm using Espresso and mockito 2.0+. Thank you.
Solution
I doubt that this question still need an answer but in cas, just know that Dependency Injection like dagger will do the job. Inject your real activity on your app and another activity in your test by loading a different module.
Answered By - Nicolas Massart
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.