summaryrefslogtreecommitdiff
path: root/core/src/androidTest/java/de/danoeh
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2019-11-06 17:17:20 +0100
committerByteHamster <info@bytehamster.com>2019-11-06 17:18:08 +0100
commitd953692443c8e5ae03027210f8a7dcb306e4730d (patch)
treee373ca4568a58fb7ab6dd6b1c92f1c28c76329fd /core/src/androidTest/java/de/danoeh
parent9df14af284bbaf719c21657c66a75478a874194e (diff)
downloadAntennaPod-d953692443c8e5ae03027210f8a7dcb306e4730d.zip
Removed commons text library that was just used 2 times
Diffstat (limited to 'core/src/androidTest/java/de/danoeh')
-rw-r--r--core/src/androidTest/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomTextTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/core/src/androidTest/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomTextTest.java b/core/src/androidTest/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomTextTest.java
new file mode 100644
index 000000000..1ab194133
--- /dev/null
+++ b/core/src/androidTest/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomTextTest.java
@@ -0,0 +1,49 @@
+package de.danoeh.antennapod.core.syndication.namespace.atom;
+
+import androidx.test.filters.SmallTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.runners.Parameterized.Parameter;
+import static org.junit.runners.Parameterized.Parameters;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit test for {@link AtomText}.
+ */
+@SmallTest
+@RunWith(Parameterized.class)
+public class AtomTextTest {
+
+ @Parameter(value = 0)
+ public String input;
+
+ @Parameter(value = 1)
+ public String expectedOutput;
+
+ @Parameters
+ public static Collection<Object[]> initParameters() {
+ return Arrays.asList(new Object[][] {
+ {"&gt;", ">"},
+ {">", ">"},
+ {"&lt;Fran&ccedil;ais&gt;", "<Français>"},
+ {"ßÄÖÜ", "ßÄÖÜ"},
+ {"&quot;", "\""},
+ {"&szlig;", "ß"},
+ {"&#8217;", "’"},
+ {"&#x2030;", "‰"},
+ {"&euro;", "€"},
+ });
+ }
+
+ @Test
+ public void testProcessingHtml() {
+ final AtomText atomText = new AtomText("", new NSAtom(), AtomText.TYPE_HTML);
+ atomText.setContent(input);
+ assertEquals(expectedOutput, atomText.getProcessedContent());
+ }
+}