aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/cgWaypointTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/cgWaypointTest.java')
-rw-r--r--tests/src/cgeo/geocaching/cgWaypointTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/cgWaypointTest.java b/tests/src/cgeo/geocaching/cgWaypointTest.java
new file mode 100644
index 0000000..aee101e
--- /dev/null
+++ b/tests/src/cgeo/geocaching/cgWaypointTest.java
@@ -0,0 +1,36 @@
+package cgeo.geocaching;
+
+import cgeo.geocaching.cgWaypoint;
+
+import android.test.AndroidTestCase;
+
+import junit.framework.Assert;
+
+public class cgWaypointTest extends AndroidTestCase {
+
+ @SuppressWarnings("static-method")
+ public void testOrder() {
+ final cgWaypoint wp1 = new cgWaypoint();
+ final cgWaypoint wp2 = new cgWaypoint();
+
+ wp1.setPrefix("PK");
+ wp2.setPrefix("X");
+ Assert.assertTrue(wp1.compareTo(wp2) < 0);
+
+ wp1.setPrefix("S1");
+ Assert.assertTrue(wp1.compareTo(wp2) > 0);
+
+ wp2.setPrefix("S3");
+ Assert.assertTrue(wp1.compareTo(wp2) < 0);
+
+ wp1.setPrefix("S10");
+ Assert.assertTrue(wp1.compareTo(wp2) > 0);
+
+ wp2.setPrefix("FI");
+ Assert.assertTrue(wp1.compareTo(wp2) < 0);
+
+ wp1.setPrefix("OWN");
+ Assert.assertTrue(wp1.compareTo(wp2) > 0);
+ }
+
+}