dimanche 28 juillet 2019

How can i get/ mock activity while implementing instrumented tests?

I'm trying to implement a test which requires activity as parameter, and i can't find a way to mock activity.

For example, whenever i need context in a test i usually use:

Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();

But can't find something similar for activity. Any idea?

Aucun commentaire:

Enregistrer un commentaire