Added unit test for shownotes

This commit is contained in:
ByteHamster 2018-03-23 16:01:48 +01:00
parent 97b5779c4a
commit fdc5b43ab7
1 changed files with 35 additions and 0 deletions

View File

@ -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());
}
}