From f89ee124998540a981c606213b95fb97f467a68c Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Fri, 21 Jun 2013 18:58:40 +0200 Subject: refactoring: add test for loading of cache history --- tests/src/cgeo/geocaching/cgDataTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/src') diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java index a6fb846..ce825f6 100644 --- a/tests/src/cgeo/geocaching/cgDataTest.java +++ b/tests/src/cgeo/geocaching/cgDataTest.java @@ -131,4 +131,15 @@ public class cgDataTest extends CGeoTestCase { assertNotNull("Logs must not be null", logs); assertEquals("Logs from empty geocode must be empty", 0, logs.size()); } + + public static void testLoadCacheHistory() { + int sumCaches = 0; + for (CacheType cacheType : CacheType.values()) { + SearchResult historyOfType = cgData.getHistoryOfCaches(false, cacheType); + assertNotNull(historyOfType); + sumCaches += historyOfType.getCount(); + } + // check that two different routines behave the same + assertEquals(cgData.getAllHistoryCachesCount(), sumCaches); + } } -- cgit v1.1