mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-07 05:33:38 -05:00
move main project files into standard gradle/Android Studio layout
This makes it a lot easier to setup all the testing stuff. Mostly, I'm tired of fighting Android Studio's fragility, so I want to remove as much non-standardness as possible in the hopes of improving that situation. closes #534 https://gitlab.com/fdroid/fdroidclient/issues/534
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package mock;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.test.mock.MockContentResolver;
|
||||
import android.test.mock.MockContext;
|
||||
|
||||
public class MockContextSwappableComponents extends MockContext {
|
||||
|
||||
private PackageManager packageManager;
|
||||
private Resources resources;
|
||||
private MockContentResolver contentResolver;
|
||||
|
||||
public MockContextSwappableComponents setPackageManager(PackageManager pm) {
|
||||
packageManager = pm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MockContextSwappableComponents setResources(Resources resources) {
|
||||
this.resources = resources;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MockContextSwappableComponents setContentResolver(MockContentResolver contentResolver) {
|
||||
this.contentResolver = contentResolver;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackageManager getPackageManager() {
|
||||
return packageManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MockContentResolver getContentResolver() {
|
||||
return contentResolver;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user