예제 #1
0
 private static void assertTime(final String description, final int hours, final int minutes) {
   final Geocache cache = new Geocache();
   cache.setDescription(description);
   cache.setType(CacheType.EVENT);
   final int minutesAfterMidnight = hours * 60 + minutes;
   assertThat(cache.guessEventTimeMinutes()).isEqualTo(minutesAfterMidnight);
 }
예제 #2
0
 public static void testGuessEventTimeShortDescription() {
   final Geocache cache = new Geocache();
   cache.setType(CacheType.EVENT);
   cache.setDescription(StringUtils.EMPTY);
   cache.setShortDescription("text 14:20 text");
   assertThat(cache.guessEventTimeMinutes()).isEqualTo(14 * 60 + 20);
 }
예제 #3
0
 private static void assertNoTime(final String description) {
   final Geocache cache = new Geocache();
   cache.setDescription(description);
   cache.setType(CacheType.EVENT);
   assertThat(cache.guessEventTimeMinutes()).isEqualTo(-1);
 }