From fdc5b43ab70f226f9463a84f79ae260af08cb376 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 23 Mar 2018 16:01:48 +0100 Subject: Added unit test for shownotes --- .../java/de/test/antennapod/feed/FeedItemTest.java | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/src/androidTest/java/de/test/antennapod/feed/FeedItemTest.java (limited to 'app') diff --git a/app/src/androidTest/java/de/test/antennapod/feed/FeedItemTest.java b/app/src/androidTest/java/de/test/antennapod/feed/FeedItemTest.java new file mode 100644 index 000000000..c991ccd39 --- /dev/null +++ b/app/src/androidTest/java/de/test/antennapod/feed/FeedItemTest.java @@ -0,0 +1,35 @@ +package de.test.antennapod.feed; + +import android.test.AndroidTestCase; +import de.danoeh.antennapod.core.feed.FeedItem; + +public class FeedItemTest extends AndroidTestCase { + + public void testShownoteLength() throws Exception { + FeedItem item = new FeedItem(); + + item.setDescription(null); + item.setContentEncoded("Hello world"); + assertEquals("Hello world", item.loadShownotes().call()); + + item.setDescription(""); + item.setContentEncoded("Hello world"); + assertEquals("Hello world", item.loadShownotes().call()); + + item.setDescription("Hello world"); + item.setContentEncoded(null); + assertEquals("Hello world", item.loadShownotes().call()); + + item.setDescription("Hello world"); + item.setContentEncoded(""); + assertEquals("Hello world", item.loadShownotes().call()); + + item.setDescription("Hi"); + item.setContentEncoded("Hello world"); + assertEquals("Hello world", item.loadShownotes().call()); + + item.setDescription("Hello world"); + item.setContentEncoded("Hi"); + assertEquals("Hello world", item.loadShownotes().call()); + } +} -- cgit v1.2.3