aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2013-02-07 21:43:38 +0100
committerrsudev <rasch@munin-soft.de>2013-02-07 21:43:38 +0100
commit5b9fbd0a7acd913b33fa610cc7af8f8c19761eb4 (patch)
tree1f678141ae46e875c8eb5ce3d6d5ca3e1b3c528b /tests
parenta6443368f75b9635a6ce83328c04eb53b172c906 (diff)
downloadcgeo-5b9fbd0a7acd913b33fa610cc7af8f8c19761eb4.zip
cgeo-5b9fbd0a7acd913b33fa610cc7af8f8c19761eb4.tar.gz
cgeo-5b9fbd0a7acd913b33fa610cc7af8f8c19761eb4.tar.bz2
New tests for OC
- base cache load test - test for #2459
Diffstat (limited to 'tests')
-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);
+ }
+ }
+}