aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java
blob: 32ab1f20ee32d828df38f8faea0cb56629c23c4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package cgeo.geocaching.connector.gc;

import junit.framework.TestCase;

public class GCBaseTest extends TestCase {
    public static void testSplitJSONKey() {
        assertKey("(1, 2)", 1, 2);
        assertKey("(12, 34)", 12, 34);
        assertKey("(1234,56)", 1234, 56);
        assertKey("(1234,  567)", 1234, 567);
    }

    private static void assertKey(String key, int x, int y) {
        UTFGridPosition pos = UTFGridPosition.fromString(key);
        assertEquals(x, pos.getX());
        assertEquals(y, pos.getY());
    }
}