aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/cgeoApplicationTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/cgeoApplicationTest.java')
-rw-r--r--tests/src/cgeo/geocaching/cgeoApplicationTest.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
index 20743f1..3dcf2e3 100644
--- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java
+++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
@@ -9,7 +9,6 @@ import android.test.suitebuilder.annotation.SmallTest;
import java.util.Date;
import java.util.HashMap;
-import java.util.UUID;
import junit.framework.Assert;
@@ -54,8 +53,8 @@ public class cgeoApplicationTest extends ApplicationTestCase<cgeoapplication> {
*/
@MediumTest
public void testSearchByGeocode() {
- final UUID id = base.searchByGeocode("GC1RMM2", null, 0, true, null);
- Assert.assertNotNull(id);
+ final cgSearch search = base.searchByGeocode("GC1RMM2", null, 0, true, null);
+ Assert.assertNotNull(search);
}
/**
@@ -68,7 +67,7 @@ public class cgeoApplicationTest extends ApplicationTestCase<cgeoapplication> {
cgCacheWrap caches = cgBase.parseCacheFromText(cache.getData(), 0, null);
cgCache cacheParsed = caches.cacheList.get(0);
Assert.assertEquals(cache.getGeocode(), cacheParsed.getGeocode());
- Assert.assertEquals(cache.getType(), cacheParsed.getType());
+ Assert.assertEquals(cache.getCacheType(), cacheParsed.getCacheType());
Assert.assertEquals(cache.getOwner(), cacheParsed.getOwner());
Assert.assertEquals(cache.getDifficulty(), cacheParsed.getDifficulty());
Assert.assertEquals(cache.getTerrain(), cacheParsed.getTerrain());
@@ -118,22 +117,25 @@ public class cgeoApplicationTest extends ApplicationTestCase<cgeoapplication> {
public void testSearchTrackable() {
cgTrackable tb = base.searchTrackable("TB2J1VZ", null, null);
+ // fix data
assertEquals("aefffb86-099f-444f-b132-605436163aa8", tb.getGuid());
assertEquals("TB2J1VZ", tb.getGeocode());
assertEquals("http://www.geocaching.com/images/wpttypes/21.gif", tb.getIconUrl());
assertEquals("blafoo's Children Music CD", tb.getName());
assertEquals("Travel Bug Dog Tag", tb.getType());
assertEquals(new Date(2009 - 1900, 8 - 1, 24), tb.getReleased());
- assertEquals(10617.8f, tb.getDistance());
assertEquals("Niedersachsen, Germany", tb.getOrigin());
assertEquals("blafoo", tb.getOwner());
assertEquals("0564a940-8311-40ee-8e76-7e91b2cf6284", tb.getOwnerGuid());
- assertEquals("Nice place for a break cache", tb.getSpottedName());
- assertEquals(cgTrackable.SPOTTED_CACHE, tb.getSpottedType());
- assertEquals("faa2d47d-19ea-422f-bec8-318fc82c8063", tb.getSpottedGuid());
assertEquals("Kinder erfreuen.<br/><br/>Make children happy.", tb.getGoal());
assertTrue(tb.getDetails().startsWith("Auf der CD sind"));
assertEquals("http://img.geocaching.com/track/display/38382780-87a7-4393-8393-78841678ee8c.jpg", tb.getImage());
- assertEquals(10, tb.getLogs().size());
+ // changing data
+ assertTrue(tb.getDistance() >= 10617.8f);
+ assertTrue(tb.getLogs().size() >= 10);
+ assertTrue(cgTrackable.SPOTTED_CACHE == tb.getSpottedType() || cgTrackable.SPOTTED_OWNER == tb.getSpottedType());
+ // no assumption possible: assertEquals("faa2d47d-19ea-422f-bec8-318fc82c8063", tb.getSpottedGuid());
+ // no assumption possible: assertEquals("Nice place for a break cache", tb.getSpottedName());
+
}
}