diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2013-10-19 19:01:32 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2013-10-19 19:01:32 +0200 |
commit | f8464a5954ded9e985cd137eeb2e32322943a633 (patch) | |
tree | 51a8ca8eba27757bf2f15ea49e34383e9906c432 /tests | |
parent | 737788256d41e51a707e4155e3f0b9bc49be4dd0 (diff) | |
download | cgeo-f8464a5954ded9e985cd137eeb2e32322943a633.zip cgeo-f8464a5954ded9e985cd137eeb2e32322943a633.tar.gz cgeo-f8464a5954ded9e985cd137eeb2e32322943a633.tar.bz2 |
fix #3371: Log-offline-menu doesn't respect cache source
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/cgeo/geocaching/GeocacheTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/GeocacheTest.java b/tests/src/cgeo/geocaching/GeocacheTest.java index 6d3eec3..f7e4e84 100644 --- a/tests/src/cgeo/geocaching/GeocacheTest.java +++ b/tests/src/cgeo/geocaching/GeocacheTest.java @@ -2,6 +2,7 @@ package cgeo.geocaching; import cgeo.CGeoTestCase; import cgeo.geocaching.enumerations.CacheType; +import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.list.StoredList; @@ -252,4 +253,18 @@ public class GeocacheTest extends CGeoTestCase { cache.setType(CacheType.EVENT); assertNull(cache.guessEventTimeMinutes()); } + + public static void testGetPossibleLogTypes() throws Exception { + Geocache gcCache = new Geocache(); + gcCache.setGeocode("GC123"); + gcCache.setType(CacheType.WEBCAM); + assertTrue(gcCache.getPossibleLogTypes().contains(LogType.WEBCAM_PHOTO_TAKEN)); + assertTrue("GC caches can have maintenance logs", gcCache.getPossibleLogTypes().contains(LogType.NEEDS_MAINTENANCE)); + + Geocache ocCache = new Geocache(); + ocCache.setGeocode("OC1234"); + ocCache.setType(CacheType.TRADITIONAL); + assertFalse("A traditional cache cannot have a webcam log", ocCache.getPossibleLogTypes().contains(LogType.WEBCAM_PHOTO_TAKEN)); + assertFalse("OC caches have no maintenance log type", ocCache.getPossibleLogTypes().contains(LogType.NEEDS_MAINTENANCE)); + } } |