summaryrefslogtreecommitdiff
path: root/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-05-25 15:40:12 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-05-25 15:40:12 +0200
commitdbff918e3a41e5e348f3d501d899c463a409f93e (patch)
treecbb6174a92d16e872110d3091672555706419b6d /src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
parenteb0f48d3c34c58951c2eb914a7ec20376ddaec2a (diff)
downloadAntennaPod-dbff918e3a41e5e348f3d501d899c463a409f93e.zip
Added support for "pcast"-protocol, start FeedViewActivity immediately when clicking on a link. closes #425
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java')
-rw-r--r--src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java b/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
new file mode 100644
index 000000000..64d45dc60
--- /dev/null
+++ b/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
@@ -0,0 +1,40 @@
+package instrumentationTest.de.test.antennapod.util;
+
+import android.test.AndroidTestCase;
+import de.danoeh.antennapod.util.URLChecker;
+
+/**
+ * Test class for URLChecker
+ */
+public class URLCheckerTest extends AndroidTestCase {
+
+ public void testCorrectURLHttp() {
+ final String in = "http://example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals(in, out);
+ }
+
+ public void testCorrectURLHttps() {
+ final String in = "https://example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals(in, out);
+ }
+
+ public void testMissingProtocol() {
+ final String in = "example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals("http://example.com", out);
+ }
+
+ public void testFeedProtocol() {
+ final String in = "feed://example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals("http://example.com", out);
+ }
+
+ public void testPcastProtocol() {
+ final String in = "pcast://example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals("http://example.com", out);
+ }
+}