Mocking Context Testing in Android can be complex, especially when your component is not isolated from the Android framework. One example of this is when your component is performing file system tasks using Context. E.g, the Activity class has the following methods (inherited from Context): openOrCreateDatabase(); deleteDatabase(); getDatabasePath(); openFileInput(); openFileOutput(); getFileStreamPath(); deleteFile(); getCacheDir(); When calling […]
The post Using RenamingDelegatingContext to mock ContentResolver in Android appeared first on blog..