diff options
Diffstat (limited to 'tests/src/cgeo/geocaching')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgDataTest.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java index ce825f6..cc1148a 100644 --- a/tests/src/cgeo/geocaching/cgDataTest.java +++ b/tests/src/cgeo/geocaching/cgDataTest.java @@ -134,11 +134,18 @@ public class cgDataTest extends CGeoTestCase { public static void testLoadCacheHistory() { int sumCaches = 0; + int allCaches = 0; for (CacheType cacheType : CacheType.values()) { SearchResult historyOfType = cgData.getHistoryOfCaches(false, cacheType); assertNotNull(historyOfType); - sumCaches += historyOfType.getCount(); + if (cacheType != CacheType.ALL) { + sumCaches += historyOfType.getCount(); + } else { + allCaches = historyOfType.getCount(); + } } + // check that sum of types equals 'all' + assertEquals(sumCaches, allCaches); // check that two different routines behave the same assertEquals(cgData.getAllHistoryCachesCount(), sumCaches); } |
