diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-02-17 22:05:47 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-02-17 22:05:47 +0100 |
commit | 2afcb580bf88c0b88fb05d7fefb35b739b1978c5 (patch) | |
tree | d7925798d7cc1b72dde453bced5b9592359defde /src/instrumentationTest/de/test/antennapod | |
parent | f67d9a13693e3e051b0e774f6e2334a1a0d9c08b (diff) | |
download | AntennaPod-2afcb580bf88c0b88fb05d7fefb35b739b1978c5.zip |
FeedStatistics list was not sorted correctly
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod')
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java index 78fe3b701..b03d83d25 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java @@ -6,6 +6,7 @@ import de.danoeh.antennapod.feed.Feed; import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.feed.FeedMedia; import de.danoeh.antennapod.storage.DBReader; +import de.danoeh.antennapod.storage.FeedItemStatistics; import de.danoeh.antennapod.storage.PodDBAdapter; import de.danoeh.antennapod.util.flattr.FlattrStatus; import static instrumentationTest.de.test.antennapod.storage.DBTestUtils.*; @@ -351,4 +352,17 @@ public class DBReaderTest extends InstrumentationTestCase { assertEquals("Wrong sort order: ", item.getId(), ids[i]); } } + + public void testGetFeedStatisticsCheckOrder() { + final Context context = getInstrumentation().getTargetContext(); + final int NUM_FEEDS = 10; + final int NUM_ITEMS = 10; + List<Feed> feeds = DBTestUtils.saveFeedlist(context, NUM_FEEDS, NUM_ITEMS, false); + List<FeedItemStatistics> statistics = DBReader.getFeedStatisticsList(context); + assertNotNull(statistics); + assertEquals(feeds.size(), statistics.size()); + for (int i = 0; i < NUM_FEEDS; i++) { + assertEquals("Wrong entry at index " + i, feeds.get(i).getId(), statistics.get(i).getFeedID()); + } + } } |