Created
November 6, 2015 19:48
-
-
Save jeffypooo/f4e899215174e376ef45 to your computer and use it in GitHub Desktop.
Unit Test setup for code using Parse's Android SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(RobolectricTestRunner.class) | |
@Config(manifest = TestConstants.MOBILE_ROBOLECTRIC_MANIFEST_PATH, sdk = 21) | |
public abstract class ParseTestBase { | |
static boolean parseInit = false; | |
@Before | |
public void setup() throws ParseException { | |
if (!parseInit) { | |
Context context = ShadowApplication.getInstance().getApplicationContext(); | |
Parse.enableLocalDatastore(context); | |
Parse.initialize(context, "<app-id-here>", "<client-key-here>"); | |
ParseUser.enableAutomaticUser(); | |
parseInit = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment