Unit Test android.provider -


i'm trying provide 100% test coverage , stuck on android methods, example:

public static boolean aremocklocationsenabled(context context) {     return settings.secure.getstring(context.getcontentresolver(), settings.secure.allow_mock_location).equals("1"); } 

i can't mock settings because it's using android.provider , not passed in. i've read providertestcase2 can't find many examples. there way mock or inject these android system settings?


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -