From 605d14aad4f3431a8028d83e02afbdb3ee71191f Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Tue, 14 Feb 2012 06:01:53 +0100 Subject: fix tests for stored lists * count member shall not be accessible outside * use global app functions for getting current list item count --- tests/src/cgeo/geocaching/cgDataTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/src/cgeo/geocaching/cgDataTest.java') 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 { 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 { 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 { // 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); -- cgit v1.1