diff options
| author | Bananeweizen <Bananeweizen@gmx.de> | 2012-12-29 10:20:34 +0100 |
|---|---|---|
| committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-12-29 10:20:34 +0100 |
| commit | 7d6c8ca06ab9c7833875fdd77bacd2471a9e5a41 (patch) | |
| tree | cbb7b41a8c5b6fca0613afab43ea96317de3b360 /tests/src | |
| parent | f0ca3839442f1702d729e02045d536a35da874dd (diff) | |
| download | cgeo-7d6c8ca06ab9c7833875fdd77bacd2471a9e5a41.zip cgeo-7d6c8ca06ab9c7833875fdd77bacd2471a9e5a41.tar.gz cgeo-7d6c8ca06ab9c7833875fdd77bacd2471a9e5a41.tar.bz2 | |
fix #2300: WP "Original coords" does not have a type
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/cgeo/geocaching/ui/FormatterTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/ui/FormatterTest.java b/tests/src/cgeo/geocaching/ui/FormatterTest.java new file mode 100644 index 0000000..8f48abb --- /dev/null +++ b/tests/src/cgeo/geocaching/ui/FormatterTest.java @@ -0,0 +1,30 @@ +package cgeo.geocaching.ui; + +import cgeo.geocaching.R; +import cgeo.geocaching.cgWaypoint; +import cgeo.geocaching.cgeoapplication; +import cgeo.geocaching.enumerations.WaypointType; + +import android.test.AndroidTestCase; + +public class FormatterTest extends AndroidTestCase { + + public static void testParkingWaypoint() { + assertFormatting(new cgWaypoint("you can park here", WaypointType.PARKING, false), WaypointType.PARKING.getL10n()); + } + + public static void testOriginalWaypoint() { + assertFormatting(new cgWaypoint("an original", WaypointType.ORIGINAL, false), WaypointType.ORIGINAL.getL10n()); + } + + public static void testOwnWaypoint() { + cgWaypoint own = new cgWaypoint("my own", WaypointType.OWN, true); + own.setPrefix(cgWaypoint.PREFIX_OWN); + assertFormatting(own, cgeoapplication.getInstance().getString(R.string.waypoint_custom)); + } + + private static void assertFormatting(cgWaypoint waypoint, String expected) { + assertEquals(expected, Formatter.formatWaypointInfo(waypoint)); + } + +} |
