aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo
diff options
context:
space:
mode:
authorblafoo <github@blafoo.de>2012-02-18 23:39:12 +0100
committerblafoo <github@blafoo.de>2012-02-23 23:19:51 +0100
commit8035e5c16fd013a18d398ab14532a8fff482a459 (patch)
treeb9d320ee49a15b3d88d8260b23ff254130a7a1c7 /tests/src/cgeo
parentad44c44eb525dfd31821a57aa18242de214039f5 (diff)
downloadcgeo-8035e5c16fd013a18d398ab14532a8fff482a459.zip
cgeo-8035e5c16fd013a18d398ab14532a8fff482a459.tar.gz
cgeo-8035e5c16fd013a18d398ab14532a8fff482a459.tar.bz2
Positions in grid evaluated for caches
Diffstat (limited to 'tests/src/cgeo')
-rw-r--r--tests/src/cgeo/geocaching/connector/GCConnectorTest.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/connector/GCConnectorTest.java b/tests/src/cgeo/geocaching/connector/GCConnectorTest.java
index 10f2653..072d163 100644
--- a/tests/src/cgeo/geocaching/connector/GCConnectorTest.java
+++ b/tests/src/cgeo/geocaching/connector/GCConnectorTest.java
@@ -1,6 +1,7 @@
package cgeo.geocaching.connector;
import cgeo.geocaching.SearchResult;
+import cgeo.geocaching.connector.gc.GCBase;
import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.test.mock.GC2JVEH;
@@ -10,11 +11,22 @@ public class GCConnectorTest extends AndroidTestCase {
@SuppressWarnings("null")
public static void testGetViewport() {
+
GC2JVEH cache = new GC2JVEH();
final Viewport viewport = new Viewport(cache.getCoords(), 1.0, 1.0);
- SearchResult searchResult = GCConnectorImpl.searchByViewport(viewport);
+ SearchResult searchResult = GCBase.searchByViewport(viewport);
assertTrue(searchResult != null);
- assertTrue(searchResult.getGeocodes().contains(cache.getGeocode()));
+ assertEquals(3, searchResult.getCount());
+ assertTrue(searchResult.getGeocodes().contains("GC211WG"));
+ }
+
+ public static void testBaseCodings() {
+ assertEquals(2045702, GCBase.newidToGCId("CpLB"));
+ assertEquals("CpLB", GCBase.gcidToNewId(2045702));
+ assertEquals(2045702, GCBase.gccodeToGCId("GC2MEGA"));
+ assertEquals("GC2MEGA", GCBase.gcidToGCCode(2045702));
+
+ assertEquals("GC211WG", GCBase.newidToGeocode("gEaR"));
}
}