aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/LogTemplateProviderTest.java
blob: 2e6057ff6685caab5846d50e268b69c24aabb3cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package cgeo.geocaching;

import cgeo.geocaching.utils.LogTemplateProvider;

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, 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]", true).contains(currentYear));
    }

}