mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-07-07 00:34:42 -04:00
Testing now working
Still requires shenanigans in its own right, but this is a much better platform. Plus, I don't need to mess with the application context, all I do is change the injections.
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
package org.bspeice.minimalbible;
|
||||
|
||||
import android.app.Application;
|
||||
import android.test.ApplicationTestCase;
|
||||
|
||||
/**
|
||||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
|
||||
*/
|
||||
public class ApplicationTest extends ApplicationTestCase<Application> {
|
||||
public ApplicationTest() {
|
||||
super(Application.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package org.bspeice.minimalbible;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.test.ActivityUnitTestCase;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* Created by Bradlee Speice on 7/5/2014.
|
||||
*/
|
||||
public class DownloadActivityTest extends ActivityUnitTestCase<DownloadActivity> {
|
||||
|
||||
public DownloadActivityTest() {
|
||||
super(DownloadActivity.class);
|
||||
}
|
||||
|
||||
public void testAndroidTestInjection() {
|
||||
MinimalBible m = new MinimalBible();
|
||||
m.buildObjGraph();
|
||||
setApplication(m);
|
||||
|
||||
startActivity(new Intent(getInstrumentation().getTargetContext(),
|
||||
DownloadActivity.class), null, null);
|
||||
|
||||
DownloadActivity a = getActivity();
|
||||
assertNotNull(a);
|
||||
|
||||
Log.w("DownloadActivityTest", a.actionTitle);
|
||||
assertEquals(a.actionTitle, a.actionTitle, "Test");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user