From 9bcde0b7d76eb4f1dfe468738368efc41e82aff7 Mon Sep 17 00:00:00 2001 From: rsudev Date: Thu, 4 Jul 2013 07:30:16 +0200 Subject: Fix history test Until now it worked only if there were no caches in history --- tests/src/cgeo/geocaching/cgDataTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (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 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); } -- cgit v1.1