From 3ce1488a9fafd44992d7a408146a9b1c3702f11e Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Wed, 29 Jan 2014 07:55:09 +0100 Subject: read premium only flag from GSAK GPX --- tests/src/cgeo/geocaching/files/GPXParserTest.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tests/src') 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 caches = readGPX10(R.raw.gc3t1xg_gsak); + private Geocache getFirstCache(int gpxResourceId) throws IOException, ParserException { + final List 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 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()); + } + } -- cgit v1.1