mardi 3 mai 2016

How to mock getApplicationInfo().dataDir

How do we mock getApplicationInfo.dataDir? Below is the code Code Snippet:

 private DatabaseHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        this.mContext = context;
        DATABASE_PATH = mContext.getApplicationInfo().dataDir + "/databases/";
        try {
            createDataBase();
            openDataBase();
        } catch (IOException e) {
            throw new Error("ErrorCopyingDataBase");
        }
    }

Aucun commentaire:

Enregistrer un commentaire