diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-07-20 07:34:33 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-07-20 07:34:33 +0200 |
| commit | 8801cfcf6ab3848f11bbd5f458cb252366035d8b (patch) | |
| tree | 56a8a88e9c7f0594b003d1b2905d91d81656eb31 /tests/src/cgeo/geocaching/utils/FormatterTest.java | |
| parent | 59201fa2f1087e76a68ade92d4f0f41a86a79e9a (diff) | |
| download | cgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.zip cgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.tar.gz cgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.tar.bz2 | |
refactoring: reduce package cycles
Diffstat (limited to 'tests/src/cgeo/geocaching/utils/FormatterTest.java')
| -rw-r--r-- | tests/src/cgeo/geocaching/utils/FormatterTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/utils/FormatterTest.java b/tests/src/cgeo/geocaching/utils/FormatterTest.java new file mode 100644 index 0000000..c91445d --- /dev/null +++ b/tests/src/cgeo/geocaching/utils/FormatterTest.java @@ -0,0 +1,33 @@ +package cgeo.geocaching.utils; + +import static org.assertj.core.api.Assertions.assertThat; + +import cgeo.geocaching.CgeoApplication; +import cgeo.geocaching.R; +import cgeo.geocaching.Waypoint; +import cgeo.geocaching.enumerations.WaypointType; +import cgeo.geocaching.utils.Formatter; + +import android.test.AndroidTestCase; + +public class FormatterTest extends AndroidTestCase { + + public static void testParkingWaypoint() { + assertFormatting(new Waypoint("you can park here", WaypointType.PARKING, false), WaypointType.PARKING.getL10n()); + } + + public static void testOriginalWaypoint() { + assertFormatting(new Waypoint("an original", WaypointType.ORIGINAL, false), WaypointType.ORIGINAL.getL10n()); + } + + public static void testOwnWaypoint() { + final Waypoint own = new Waypoint("my own", WaypointType.OWN, true); + own.setPrefix(Waypoint.PREFIX_OWN); + assertFormatting(own, CgeoApplication.getInstance().getString(R.string.waypoint_custom)); + } + + private static void assertFormatting(Waypoint waypoint, String expected) { + assertThat(Formatter.formatWaypointInfo(waypoint)).isEqualTo(expected); + } + +} |
