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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -