diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-29 07:55:09 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-29 07:55:09 +0100 |
| commit | 3ce1488a9fafd44992d7a408146a9b1c3702f11e (patch) | |
| tree | cc87e3245dded647efb4a2149855ed1c2f3ee30e /tests | |
| parent | b2d6de1a58e2894373b48054e4ef60a94abcbd88 (diff) | |
| download | cgeo-3ce1488a9fafd44992d7a408146a9b1c3702f11e.zip cgeo-3ce1488a9fafd44992d7a408146a9b1c3702f11e.tar.gz cgeo-3ce1488a9fafd44992d7a408146a9b1c3702f11e.tar.bz2 | |
read premium only flag from GSAK GPX
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/res/raw/gc3t1xg_gsak.gpx | 2 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/tests/res/raw/gc3t1xg_gsak.gpx b/tests/res/raw/gc3t1xg_gsak.gpx index 3c09a97..ebb5ca5 100644 --- a/tests/res/raw/gc3t1xg_gsak.gpx +++ b/tests/res/raw/gc3t1xg_gsak.gpx @@ -34,7 +34,7 @@ xmlns="http://www.topografix.com/GPX/1/0"> <gsak:LastGpxDate>2014-01-26</gsak:LastGpxDate> <gsak:Code>GC3T1XG</gsak:Code> <gsak:Resolution></gsak:Resolution> - <gsak:IsPremium>false</gsak:IsPremium> + <gsak:IsPremium>true</gsak:IsPremium> <gsak:FavPoints>258</gsak:FavPoints> <gsak:GcNote>Personal Note Test</gsak:GcNote> <gsak:Guid>d09416d5-dba9-4347-86a6-12f7b5ef2fff</gsak:Guid> diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index d8c49c3..9297819 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -325,19 +325,27 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { assertEquals("Wasserleitung", cache.getHint()); } - public void testGsakFavPoints() throws IOException, ParserException { - final List<Geocache> caches = readGPX10(R.raw.gc3t1xg_gsak); + private Geocache getFirstCache(int gpxResourceId) throws IOException, ParserException { + final List<Geocache> caches = readGPX10(gpxResourceId); + assertNotNull(caches); assertEquals(1, caches.size()); final Geocache cache = caches.get(0); + return cache; + } + + public void testGsakFavPoints() throws IOException, ParserException { + final Geocache cache = getFirstCache(R.raw.gc3t1xg_gsak); assertEquals(258, cache.getFavoritePoints()); } public void testGsakPersonalNote() throws IOException, ParserException { - final List<Geocache> caches = readGPX10(R.raw.gc3t1xg_gsak); - assertNotNull(caches); - assertEquals(1, caches.size()); - final Geocache cache = caches.get(0); + final Geocache cache = getFirstCache(R.raw.gc3t1xg_gsak); assertEquals("Personal Note Test", cache.getPersonalNote()); } + public void testGsakPremium() throws IOException, ParserException { + final Geocache cache = getFirstCache(R.raw.gc3t1xg_gsak); + assertTrue(cache.isPremiumMembersOnly()); + } + } |
