diff options
Diffstat (limited to 'tests/src/cgeo/geocaching/connector/gc')
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java | 2 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/GCParserTest.java | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java b/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java index 8298ad7..4458789 100644 --- a/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java @@ -10,7 +10,7 @@ public class GCConstantsTest extends AndroidTestCase { // adapt the following after downloading new mock html files public static final String MOCK_LOGIN_NAME = "JoSaMaJa"; - public static final int MOCK_CACHES_FOUND = 419; + public static final int MOCK_CACHES_FOUND = 426; public static void testLocation() { // GC37GFJ diff --git a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java index cf1df46..ff7ddff 100644 --- a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java @@ -7,6 +7,7 @@ import cgeo.geocaching.Settings; import cgeo.geocaching.Waypoint; import cgeo.geocaching.enumerations.LoadFlags; import cgeo.geocaching.enumerations.StatusCode; +import cgeo.geocaching.enumerations.WaypointType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; @@ -22,6 +23,7 @@ import android.os.Handler; import android.test.suitebuilder.annotation.MediumTest; import java.util.ArrayList; +import java.util.List; public class GCParserTest extends AbstractResourceInstrumentationTestCase { @@ -187,6 +189,22 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase { assertEquals(13, cache.getWaypoints().size()); } + public static void testNoteParsingWaypointTypes() { + final Geocache cache = new Geocache(); + cache.setWaypoints(new ArrayList<Waypoint>(), false); + cache.setPersonalNote("\"Parking area at PARKING=N 50° 40.666E 006° 58.222\n" + + "My calculated final coordinates: FINAL=N 50° 40.777E 006° 58.111\n" + + "Get some ice cream at N 50° 40.555E 006° 58.000\""); + + cache.parseWaypointsFromNote(); + final List<Waypoint> waypoints = cache.getWaypoints(); + + assertEquals(3, waypoints.size()); + assertEquals(WaypointType.PARKING, waypoints.get(0).getWaypointType()); + assertEquals(WaypointType.FINAL, waypoints.get(1).getWaypointType()); + assertEquals(WaypointType.WAYPOINT, waypoints.get(2).getWaypointType()); + } + private Geocache parseCache(int resourceId) { final String page = getFileContent(resourceId); final SearchResult result = GCParser.parseCacheFromText(page, null); |
