diff options
author | orionlee <orionlee@yahoo.com> | 2018-05-18 13:42:39 -0700 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2018-05-18 13:42:39 -0700 |
commit | eb0ef1e2014c8e1b8f7ff76359bd476cc52fd7b5 (patch) | |
tree | 0ef0fe3b746db7d7a6271307fed1e4006f7c4c41 /core/src/androidTest/java | |
parent | 46ae3e0b00a3b3ec8ef7ba01efad8bcfb1a79398 (diff) | |
download | AntennaPod-eb0ef1e2014c8e1b8f7ff76359bd476cc52fd7b5.zip |
core tests: Make DownloadServiceTest be a unit test (the portion of
DownloadService tested is all in-memory logic).
Diffstat (limited to 'core/src/androidTest/java')
-rw-r--r-- | core/src/androidTest/java/de/danoeh/antennapod/core/service/download/DownloadServiceTest.java | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/core/src/androidTest/java/de/danoeh/antennapod/core/service/download/DownloadServiceTest.java b/core/src/androidTest/java/de/danoeh/antennapod/core/service/download/DownloadServiceTest.java deleted file mode 100644 index ee27f6bbd..000000000 --- a/core/src/androidTest/java/de/danoeh/antennapod/core/service/download/DownloadServiceTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package de.danoeh.antennapod.core.service.download; - -import android.test.AndroidTestCase; - -import java.util.ArrayList; -import java.util.List; - -import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedImage; -import de.danoeh.antennapod.core.feed.FeedItem; - -public class DownloadServiceTest extends AndroidTestCase { - - public void testRemoveDuplicateImages() { - List<FeedItem> items = new ArrayList<>(); - for (int i = 0; i < 50; i++) { - FeedItem item = new FeedItem(); - String url = (i % 5 == 0) ? "dupe_url" : String.format("url_%d", i); - item.setImage(new FeedImage(null, url, "")); - items.add(item); - } - Feed feed = new Feed(); - feed.setItems(items); - - DownloadService.removeDuplicateImages(feed); - - assertEquals(50, items.size()); - for (int i = 0; i < items.size(); i++) { - FeedItem item = items.get(i); - String want = (i == 0) ? "dupe_url" : (i % 5 == 0) ? null : String.format("url_%d", i); - assertEquals(want, item.getImageLocation()); - } - } -} |