diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2012-02-14 06:01:53 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2012-02-14 06:01:53 +0100 |
| commit | 605d14aad4f3431a8028d83e02afbdb3ee71191f (patch) | |
| tree | 7fa343215b3ea9b60e240198ff69b9cc9240492b /tests/src/cgeo/geocaching/cgDataTest.java | |
| parent | ebabc0cf3d764b95f2713b50ae0eb280a992e59a (diff) | |
| download | cgeo-605d14aad4f3431a8028d83e02afbdb3ee71191f.zip cgeo-605d14aad4f3431a8028d83e02afbdb3ee71191f.tar.gz cgeo-605d14aad4f3431a8028d83e02afbdb3ee71191f.tar.bz2 | |
fix tests for stored lists
* count member shall not be accessible outside
* use global app functions for getting current list item count
Diffstat (limited to 'tests/src/cgeo/geocaching/cgDataTest.java')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgDataTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java index 8892ade..456baf5 100644 --- a/tests/src/cgeo/geocaching/cgDataTest.java +++ b/tests/src/cgeo/geocaching/cgDataTest.java @@ -22,11 +22,11 @@ public class cgDataTest extends ApplicationTestCase<cgeoapplication> { createApplication(); } - public static void testLists() { + public static void testStoredLists() { cgeoapplication app = cgeoapplication.getInstance(); - int listId1 = -1; - int listId2 = -1; + int listId1 = StoredList.STANDARD_LIST_ID; + int listId2 = StoredList.STANDARD_LIST_ID; // create caches final cgCache cache1 = cgBaseTest.createCache(0); @@ -64,7 +64,7 @@ public class cgDataTest extends ApplicationTestCase<cgeoapplication> { app.moveToList(cache1.getGeocode(), listId2); assertEquals(1, app.getAllStoredCachesCount(false, CacheType.ALL, listId2)); - // remove list (cache1=1, cache2=listId2) + // remove list (cache1=listId2, cache2=listId2) assertTrue(app.removeList(listId1)); // mark dropped (cache1=1, cache2=0) @@ -72,8 +72,7 @@ public class cgDataTest extends ApplicationTestCase<cgeoapplication> { // mark stored (cache1=1, cache2=listId2) app.markStored(cache2.getGeocode(), listId2); - StoredList list2 = app.getList(listId2); - //assertEquals(1, list2.count); + assertEquals(2, app.getAllStoredCachesCount(false, CacheType.ALL, listId2)); // drop stored (cache1=0, cache2=0) app.dropList(listId2); |
