aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java
diff options
context:
space:
mode:
authorkoem <koem@petoria.de>2013-02-08 20:47:01 +1300
committerkoem <koem@petoria.de>2013-02-08 20:47:01 +1300
commitb0e6123e2da3e5a4efbaca6d35b58ba940673d74 (patch)
treef2882f47e466fdffcaa63da82b30d58bf4842a70 /tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java
parentebda1db90874465df018d5b3c65e5c4393839fe6 (diff)
parent509cefa3af847129bf40cff15437183d950752a7 (diff)
downloadcgeo-b0e6123e2da3e5a4efbaca6d35b58ba940673d74.zip
cgeo-b0e6123e2da3e5a4efbaca6d35b58ba940673d74.tar.gz
cgeo-b0e6123e2da3e5a4efbaca6d35b58ba940673d74.tar.bz2
Merge branch 'master' into chooselist
Diffstat (limited to 'tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java')
-rw-r--r--tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java b/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java
new file mode 100644
index 0000000..7cfd261
--- /dev/null
+++ b/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java
@@ -0,0 +1,37 @@
+package cgeo.geocaching.connector.opencaching;
+
+import cgeo.CGeoTestCase;
+import cgeo.geocaching.Geocache;
+import cgeo.geocaching.Settings;
+import cgeo.geocaching.connector.oc.OCXMLClient;
+import cgeo.geocaching.enumerations.CacheType;
+
+public class OCXMLTest extends CGeoTestCase {
+
+ public static void testOCGetCache() {
+ String geoCode = "OCDE76";
+
+ Geocache cache = OCXMLClient.getCache(geoCode);
+ assertNotNull(cache);
+ assertEquals(geoCode, cache.getGeocode());
+ assertEquals("Gitarrenspielplatz", cache.getName());
+ assertEquals(CacheType.TRADITIONAL, cache.getType());
+ assertEquals(2.0, cache.getDifficulty(), 0.1);
+ assertEquals(2.0, cache.getTerrain(), 0.1);
+ }
+
+ public static void testOCLogAttendedAsFound() {
+
+ String oldOCName = Settings.getOCConnectorUserName();
+ try {
+ Settings.setOCConnectorUserName("ra_sch");
+ String geoCode = "OCD541";
+ Geocache cache = OCXMLClient.getCache(geoCode);
+ assertNotNull(cache);
+
+ assertTrue(cache.isFound());
+ } finally {
+ Settings.setOCConnectorUserName(oldOCName);
+ }
+ }
+}