A
A
Alexander Sinitsyn2020-04-22 08:04:10
Android
Alexander Sinitsyn, 2020-04-22 08:04:10

Is it possible to tell the app that it's being run from a test so that the test uses a different SharedPreferences store?

The name of the storage that is used in the application is stored in the STORAGE_NAME constant. So far I have only thought of adding a second TEST_STORAGE_NAME and manually changing them in getSharedPreferences.

Is it possible to find out that the application is being launched from a test and make this change by condition?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmtm, 2020-04-22
@Dmtm

> Is it possible to find out that the application is being launched from the
STORAGE_NAME test, put it in gradle, substitute it depending on the assembly

N
Neonoviiwolf, 2020-04-22
@Neonoviiwolf

5ea01f30c1fd8941259923.png
Might be worth looking into this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question