Fix tests, test runner for core tests

This commit is contained in:
Martin Fietz 2015-05-20 11:06:45 +02:00
parent b0f0d106da
commit 25cbb00b36
6 changed files with 25 additions and 17 deletions

View File

@ -376,7 +376,7 @@ public class DBReaderTest extends InstrumentationTestCase {
List<Feed> feeds = DBTestUtils.saveFeedlist(context, NUM_FEEDS, NUM_ITEMS, true);
DBReader.NavDrawerData navDrawerData = DBReader.getNavDrawerData(context);
assertEquals(NUM_FEEDS, navDrawerData.feeds.size());
assertEquals(0, navDrawerData.numUnreadItems);
assertEquals(0, navDrawerData.numNewItems);
assertEquals(0, navDrawerData.queueSize);
}
@ -405,7 +405,7 @@ public class DBReaderTest extends InstrumentationTestCase {
DBReader.NavDrawerData navDrawerData = DBReader.getNavDrawerData(context);
assertEquals(NUM_FEEDS, navDrawerData.feeds.size());
assertEquals(NUM_UNREAD, navDrawerData.numUnreadItems);
assertEquals(NUM_UNREAD, navDrawerData.numNewItems);
assertEquals(NUM_QUEUE, navDrawerData.queueSize);
}

View File

@ -9,6 +9,8 @@ android {
targetSdkVersion 21
versionCode 1
versionName "1.0"
testApplicationId "de.danoeh.antennapod.core.tests"
testInstrumentationRunner "de.danoeh.antennapod.core.tests.AntennaPodTestRunner"
}
buildTypes {
release {

View File

@ -1,13 +0,0 @@
package de.danoeh.antennapod.core.test;
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);
}
}

View File

@ -0,0 +1,15 @@
package de.danoeh.antennapod.core.tests;
import android.test.InstrumentationTestRunner;
import android.test.suitebuilder.TestSuiteBuilder;
import junit.framework.TestSuite;
public class AntennaPodTestRunner extends InstrumentationTestRunner {
@Override
public TestSuite getAllTests() {
return new TestSuiteBuilder(AntennaPodTestRunner.class)
.includeAllPackagesUnderHere()
.build();
}
}

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util;
package de.danoeh.antennapod.core.tests.util;
import android.test.AndroidTestCase;
@ -7,6 +7,8 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import de.danoeh.antennapod.core.util.DateUtils;
public class DateUtilsTest extends AndroidTestCase {
public void testParseDateWithMicroseconds() throws Exception {

View File

@ -1,7 +1,9 @@
package de.danoeh.antennapod.core.util;
package de.danoeh.antennapod.core.tests.util;
import android.test.AndroidTestCase;
import de.danoeh.antennapod.core.util.LongIntMap;
public class LongLongMapTest extends AndroidTestCase {
public void testEmptyMap() {