aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2015-02-08 10:39:46 +0100
committerBananeweizen <bananeweizen@gmx.de>2015-02-08 10:39:46 +0100
commit6641a9b054250769416d1dc2136b135f1283a10a (patch)
tree3450dd013aeb3e2e50df9dd43da67acbe80b3c91 /tests
parentce3ae0201b919e9454b605cfa20ceaf4b1789a5f (diff)
downloadcgeo-6641a9b054250769416d1dc2136b135f1283a10a.zip
cgeo-6641a9b054250769416d1dc2136b135f1283a10a.tar.gz
cgeo-6641a9b054250769416d1dc2136b135f1283a10a.tar.bz2
fix #4661: disallow future logs
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/utils/DateUtilsTest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/utils/DateUtilsTest.java b/tests/src/cgeo/geocaching/utils/DateUtilsTest.java
index d0a2b4a..44442f6 100644
--- a/tests/src/cgeo/geocaching/utils/DateUtilsTest.java
+++ b/tests/src/cgeo/geocaching/utils/DateUtilsTest.java
@@ -32,7 +32,7 @@ public class DateUtilsTest extends TestCase {
assertPastEvent(start, true);
}
- private static void assertPastEvent(final Calendar start, boolean expectedPast) {
+ private static void assertPastEvent(final Calendar start, final boolean expectedPast) {
final Geocache cache = new Geocache();
cache.setType(CacheType.EVENT);
@@ -40,4 +40,14 @@ public class DateUtilsTest extends TestCase {
assertThat(DateUtils.isPastEvent(cache)).isEqualTo(expectedPast);
}
+ public static void testIsFuture() {
+ final Calendar date = Calendar.getInstance();
+ assertThat(DateUtils.isFuture(date)).isFalse();
+
+ date.add(Calendar.DAY_OF_MONTH, 1);
+ assertThat(DateUtils.isFuture(date)).isFalse();
+
+ date.add(Calendar.DAY_OF_MONTH, 1);
+ assertThat(DateUtils.isFuture(date)).isTrue();
+ }
}