Code example for MockContext

0
    ContentResolver mResolver;
 
    private final Context mRealContext;
 
    public TestContext(ContentResolver resolver, Context realContext) {
        super(new RenamingDelegatingContext(new MockContext(), realContext, "test."));
        mRealContext = realContext;
        mResolver = resolver;
    } 
 
    @Override 
    public File getFilesDir() {
        return mRealContext.getFilesDir();
    } 
 
    @Override 
    public void enforceCallingOrSelfPermission(String permission, String message) {
    } 
 
    @Override 
    public void sendBroadcast(Intent intent) {