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); }
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); }
private static void assertNoTime(final String description) { final Geocache cache = new Geocache(); cache.setDescription(description); cache.setType(CacheType.EVENT); assertThat(cache.guessEventTimeMinutes()).isEqualTo(-1); }