diff options
| author | rsudev <rasch@munin-soft.de> | 2013-07-04 07:30:16 +0200 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2013-07-04 07:30:16 +0200 |
| commit | 9bcde0b7d76eb4f1dfe468738368efc41e82aff7 (patch) | |
| tree | 3d918349002126760b704745de99ab71138c8f57 | |
| parent | dd0ff6adc4b4a789920b317a254407d3cd421206 (diff) | |
| download | cgeo-9bcde0b7d76eb4f1dfe468738368efc41e82aff7.zip cgeo-9bcde0b7d76eb4f1dfe468738368efc41e82aff7.tar.gz cgeo-9bcde0b7d76eb4f1dfe468738368efc41e82aff7.tar.bz2 | |
Fix history test
Until now it worked only if there were no caches in history
| -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); } |
