mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-04 23:28:19 -05:00
Test cases pass now with the navbar
This commit is contained in:
parent
46f8e625c2
commit
60185c934a
@ -4,7 +4,6 @@ env:
|
|||||||
- ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
- ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
|
|
||||||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
|
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
|
||||||
- emulator -avd test -no-skin -no-audio -no-window &
|
- emulator -avd test -no-skin -no-audio -no-window &
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
compile 'com.squareup.dagger:dagger:1.2.1'
|
compile 'com.squareup.dagger:dagger:1.2.1'
|
||||||
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
|
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
|
||||||
|
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
package org.bspeice.minimalbible;
|
package org.bspeice.minimalbible;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.test.ActivityInstrumentationTestCase2;
|
||||||
import android.test.ActivityUnitTestCase;
|
import android.test.ActivityUnitTestCase;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Bradlee Speice on 7/5/2014.
|
* Created by Bradlee Speice on 7/5/2014.
|
||||||
*/
|
*/
|
||||||
public class DownloadActivityTest extends ActivityUnitTestCase<DownloadActivity> {
|
/* Please note that it is necessary to extend the ActivityInstrumentationTestCase2 if you plan
|
||||||
|
on using an activity that sets up any underlying fragments (includes navigation drawers).
|
||||||
|
The ActivityUnitTestCase doesn't set up enough of the Activity lifecycle.
|
||||||
|
*/
|
||||||
|
public class DownloadActivityTest extends ActivityInstrumentationTestCase2<DownloadActivity> {
|
||||||
|
|
||||||
public DownloadActivityTest() {
|
public DownloadActivityTest() {
|
||||||
super(DownloadActivity.class);
|
super(DownloadActivity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAndroidTestInjection() {
|
public void testAndroidTestInjection() {
|
||||||
MinimalBible m = new MinimalBible();
|
|
||||||
m.buildObjGraph();
|
|
||||||
setApplication(m);
|
|
||||||
|
|
||||||
startActivity(new Intent(getInstrumentation().getTargetContext(),
|
|
||||||
DownloadActivity.class), null, null);
|
|
||||||
|
|
||||||
DownloadActivity a = getActivity();
|
DownloadActivity a = getActivity();
|
||||||
assertNotNull(a);
|
assertNotNull(a);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -45,12 +46,11 @@ public class DownloadActivity extends ActionBarActivity
|
|||||||
mTitle = getTitle();
|
mTitle = getTitle();
|
||||||
Log.w("DownloadActivity", "Title: " + mTitle.toString());
|
Log.w("DownloadActivity", "Title: " + mTitle.toString());
|
||||||
|
|
||||||
/*
|
|
||||||
// Set up the drawer.
|
// Set up the drawer.
|
||||||
mNavigationDrawerFragment.setUp(
|
mNavigationDrawerFragment.setUp(
|
||||||
R.id.navigation_drawer,
|
R.id.navigation_drawer,
|
||||||
(DrawerLayout) findViewById(R.id.drawer_layout));
|
(DrawerLayout) findViewById(R.id.drawer_layout));
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user