aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2015-02-21 11:43:42 +0100
committerBananeweizen <bananeweizen@gmx.de>2015-02-21 11:43:42 +0100
commit0f28169faf68b19b1218bf3c6e32c52b42017909 (patch)
tree42c4aa550766d7f3066a64fe505bbf5855146ff3 /tests
parent5d001f813364ef96988ab432d59e2a3c82dd60d5 (diff)
downloadcgeo-0f28169faf68b19b1218bf3c6e32c52b42017909.zip
cgeo-0f28169faf68b19b1218bf3c6e32c52b42017909.tar.gz
cgeo-0f28169faf68b19b1218bf3c6e32c52b42017909.tar.bz2
new: menu item to open geo checker
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java b/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java
new file mode 100644
index 0000000..70cf888
--- /dev/null
+++ b/tests/src/cgeo/geocaching/utils/CheckerUtilsTest.java
@@ -0,0 +1,24 @@
+package cgeo.geocaching.utils;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import cgeo.geocaching.Geocache;
+
+import junit.framework.TestCase;
+
+public class CheckerUtilsTest extends TestCase {
+
+ public static void testGetCheckerUrl() throws Exception {
+ assertUrl("<p style=\"text-align:center;\"><a href=\"http://geocheck.org/geo_inputchkcoord.php?gid=618932716cc7e68-c4bb-4f41-8bb1-3e0a3e374a1f\" target=\"_blank\"><img", "http://geocheck.org/geo_inputchkcoord.php?gid=618932716cc7e68-c4bb-4f41-8bb1-3e0a3e374a1f");
+ assertUrl("<p style=\"text-align:center;\"><a href=\"http://google.com/geo_inputchkcoord.php?gid=618932716cc7e68-c4bb-4f41-8bb1-3e0a3e374a1f\" target=\"_blank\"><img", null);
+ assertUrl("http://www.certitudes.org/certitude?wp=GC5MVX7", "http://www.certitudes.org/certitude?wp=GC5MVX7");
+ assertUrl("http://geochecker.com/index.php?code=e001928e3c2682ec2bae0f24b9d02cfb&action=check&wp=474350573454&name=47656f636865636b6572205465737420666f72204e33382030302e303030205737362030302e303030", "http://geochecker.com/index.php?code=e001928e3c2682ec2bae0f24b9d02cfb&action=check&wp=474350573454&name=47656f636865636b6572205465737420666f72204e33382030302e303030205737362030302e303030");
+ }
+
+ private static void assertUrl(final String description, final String expected) {
+ final Geocache geocache = new Geocache();
+ geocache.setDescription(description);
+ assertThat(CheckerUtils.getCheckerUrl(geocache)).isEqualTo(expected);
+ }
+
+}