blob: 591121843a109fe38565d6a9cb628a0d953dace6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package cgeo.geocaching.utils;
import cgeo.geocaching.utils.LogTemplateProvider.LogContext;
import java.util.Calendar;
import junit.framework.TestCase;
public class LogTemplateProviderTest extends TestCase {
public static void testApplyTemplates() {
final String noTemplates = " no templates ";
assertEquals(noTemplates, LogTemplateProvider.applyTemplates(noTemplates, new LogContext(true)));
// This test can occasionally fail if the current year changes right after the next line.
final String currentYear = Integer.toString(Calendar.YEAR);
assertTrue(LogTemplateProvider.applyTemplates("[DATE]", new LogContext(true)).contains(currentYear));
}
}
|