diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-05-17 17:24:52 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-05-17 17:24:52 +0200 |
commit | c1c3dc593e928d70ede348c4d097272c4df4947d (patch) | |
tree | dca2b97e77c94d81d5f7b0d03dda61838c9dfd95 /src/instrumentationTest | |
parent | 4ef7fccf75aa5ccac88c4735f830b4fa167b8777 (diff) | |
download | AntennaPod-c1c3dc593e928d70ede348c4d097272c4df4947d.zip |
Treat feeds with same title and different download URLs as different feeds. fixes #101
Diffstat (limited to 'src/instrumentationTest')
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java | 2 | ||||
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java index b03d83d25..cb854b88d 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBReaderTest.java @@ -78,7 +78,7 @@ public class DBReaderTest extends InstrumentationTestCase { List<Feed> feeds = saveFeedlist(context, 10, 0, false); List<Feed> savedFeeds = DBReader.getFeedList(context); assertNotNull(savedFeeds); - assertTrue(savedFeeds.size() == feeds.size()); + assertEquals(feeds.size(), savedFeeds.size()); for (int i = 0; i < feeds.size(); i++) { assertTrue(savedFeeds.get(i).getId() == feeds.get(i).getId()); } diff --git a/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java b/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java index 2372757ce..9ab1481be 100644 --- a/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java +++ b/src/instrumentationTest/de/test/antennapod/storage/DBTasksTest.java @@ -212,6 +212,22 @@ public class DBTasksTest extends InstrumentationTestCase { } } + /** Two feeds with the same title, but different download URLs should be treated as different feeds. */ + public void testUpdateFeedSameTitle() { + final Context context = getInstrumentation().getTargetContext(); + + Feed feed1 = new Feed("url1", new Date(), "title"); + Feed feed2 = new Feed("url2", new Date(), "title"); + + feed1.setItems(new ArrayList<FeedItem>()); + feed2.setItems(new ArrayList<FeedItem>()); + + Feed savedFeed1 = DBTasks.updateFeed(context, feed1); + Feed savedFeed2 = DBTasks.updateFeed(context, feed2); + + assertTrue(savedFeed1.getId() != savedFeed2.getId()); + } + public void testUpdateFeedUpdatedFeed() { final Context context = getInstrumentation().getTargetContext(); final int NUM_ITEMS_OLD = 10; |