diff options
| author | blafoo <github@blafoo.de> | 2012-01-23 23:36:50 +0100 |
|---|---|---|
| committer | blafoo <github@blafoo.de> | 2012-01-23 23:36:50 +0100 |
| commit | bc5309a0c0797eabaac834d971d27298fa8d786e (patch) | |
| tree | 7e7ea8394f39670f5aa2e4fe2302752ecc3a921d /tests | |
| parent | d14590aa4fa417a56972b894eb0bbf974964466e (diff) | |
| download | cgeo-bc5309a0c0797eabaac834d971d27298fa8d786e.zip cgeo-bc5309a0c0797eabaac834d971d27298fa8d786e.tar.gz cgeo-bc5309a0c0797eabaac834d971d27298fa8d786e.tar.bz2 | |
Set instead of List to avoid caches multiple times in search results V2
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgBaseTest.java | 4 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/cgeoApplicationTest.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/cgBaseTest.java b/tests/src/cgeo/geocaching/cgBaseTest.java index f286fb6..99130d7 100644 --- a/tests/src/cgeo/geocaching/cgBaseTest.java +++ b/tests/src/cgeo/geocaching/cgBaseTest.java @@ -82,7 +82,7 @@ public class cgBaseTest extends AndroidTestCase { // to get the same results we have to use the date format used when the mocked data was created Settings.setGcCustomDate(mockedCache.getDateFormat()); ParseResult parseResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); - cgCache parsedCache = parseResult.cacheList.get(0); + cgCache parsedCache = cgBase.getFirstElementFromSet(parseResult.cacheList); cgBaseTest.testCompareCaches(mockedCache, parsedCache); } Settings.setGcCustomDate(gcCustomDate); @@ -151,6 +151,6 @@ public class cgBaseTest extends AndroidTestCase { // to get the same results we have to use the date format used when the mocked data was created Settings.setGcCustomDate(mockedCache.getDateFormat()); final ParseResult parseResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); - return parseResult.cacheList.get(0); + return cgBase.getFirstElementFromSet(parseResult.cacheList); } }
\ No newline at end of file diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java index ebb4c07..1bb7b85 100644 --- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java +++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java @@ -134,7 +134,7 @@ public class cgeoApplicationTest extends ApplicationTestCase<cgeoapplication> { assertNotNull(search); assertEquals(1, search.getGeocodes().size()); assertTrue(search.getGeocodes().contains(cache.getGeocode())); - cgCache searchedCache = search.cacheList.get(0); + cgCache searchedCache = cgBase.getFirstElementFromSet(search.cacheList); // coords must be null if the user is not logged in assertNull(searchedCache.getCoords()); |
