In a test, we want to test string formatting in English and French. How to specify the locale in robolectric?
The method in this post doesn't work: Change language programmatically in Android
Robolectric now includes an @Config
annotation that you can put on your unit tests to specify things like this. See here for more info.
Here is what did when unit tests involve locale:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.