aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/CacheTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/CacheTest.java')
-rw-r--r--tests/src/cgeo/geocaching/CacheTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/CacheTest.java b/tests/src/cgeo/geocaching/CacheTest.java
index a76764d..e1d6efb 100644
--- a/tests/src/cgeo/geocaching/CacheTest.java
+++ b/tests/src/cgeo/geocaching/CacheTest.java
@@ -25,4 +25,20 @@ public class CacheTest extends AndroidTestCase {
assertFalse(cacheYesterday.canBeAddedToCalendar());
}
+ public static void testEquality() {
+ final cgCache one = new cgCache();
+ final cgCache two = new cgCache();
+
+ // identity
+ assertTrue(one.equals(one));
+
+ // different objects without geocode shall not be equal
+ assertFalse(one.equals(two));
+
+ one.setGeocode("geocode");
+ two.setGeocode("geocode");
+
+ // different objects with same geocode shall be equal
+ assertTrue(one.equals(two));
+ }
}