diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/cgeo/geocaching/utils/DateUtilsTest.java | 12 |
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(); + } } |