From 934945bddf33ec77ee77daff1add6498fe08e400 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sat, 8 Jun 2013 10:35:47 +0200 Subject: fix #2841: *.loc from waymarking not imported --- tests/src/cgeo/geocaching/files/LocParserTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/src') diff --git a/tests/src/cgeo/geocaching/files/LocParserTest.java b/tests/src/cgeo/geocaching/files/LocParserTest.java index bcc8e78..6e00b35 100644 --- a/tests/src/cgeo/geocaching/files/LocParserTest.java +++ b/tests/src/cgeo/geocaching/files/LocParserTest.java @@ -2,6 +2,7 @@ package cgeo.geocaching.files; import cgeo.geocaching.Geocache; import cgeo.geocaching.enumerations.CacheSize; +import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; @@ -35,6 +36,7 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase { assertNotNull(cache); assertEquals("OC5952", cache.getGeocode()); assertEquals("Die Schatzinsel / treasure island", cache.getName()); + assertEquals("Die unbesiegbaren Geo - Geparden", cache.getOwnerDisplayName()); assertEquals(new Geopoint(48.85968, 9.18740), cache.getCoords()); } @@ -45,9 +47,26 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase { assertNotNull(cache); assertEquals("GC1BKP3", cache.getGeocode()); assertEquals("Die Schatzinsel / treasure island", cache.getName()); + assertEquals("Die unbesiegbaren Geo - Geparden", cache.getOwnerDisplayName()); assertEquals(new Geopoint(48.859683, 9.1874), cache.getCoords()); assertEquals(1.0f, cache.getDifficulty()); assertEquals(5.0f, cache.getTerrain()); assertEquals(CacheSize.MICRO, cache.getSize()); } + + public void testWaymarkingLoc() throws IOException, ParserException { + final List waymarks = readLoc(R.raw.waymarking_loc); + assertEquals(1, waymarks.size()); + final Geocache waymark = waymarks.get(0); + assertNotNull(waymark); + assertEquals("WM7BK7", waymark.getGeocode()); + assertEquals("Römerstrasse Kornwestheim", waymark.getName()); + assertEquals("travelling", waymark.getOwnerDisplayName()); + assertEquals(new Geopoint(48.856733, 9.197683), waymark.getCoords()); + // links are not yet stored for single caches + // assertEquals("http://www.waymarking.com/waymarks/WM7BK7_Rmerstrasse_Kornwestheim", waymark.getUrl()); + assertEquals(CacheSize.UNKNOWN, waymark.getSize()); + assertEquals(CacheType.UNKNOWN, waymark.getType()); + } + } -- cgit v1.1