diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-10 22:53:17 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-11 14:27:00 +0200 |
| commit | 48cfc74434c22e2d54b32cc659877e648536e818 (patch) | |
| tree | 4d009359dd0158d58ed6429a63ec2cbc5d93052a /tests/src | |
| parent | bcbd5b8c58d40b52ae3243245c9716b95fe41ff3 (diff) | |
| download | cgeo-48cfc74434c22e2d54b32cc659877e648536e818.zip cgeo-48cfc74434c22e2d54b32cc659877e648536e818.tar.gz cgeo-48cfc74434c22e2d54b32cc659877e648536e818.tar.bz2 | |
Waypoint and caches both have coordinates, add ICoordinates interface
Geopoint obviously implements ICoordinates. Also, getLongitude() and
getLatitude() were only used in tests, remove them.
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgBaseTest.java | 3 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 4 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/test/mock/MockedCache.java | 11 |
3 files changed, 2 insertions, 16 deletions
diff --git a/tests/src/cgeo/geocaching/cgBaseTest.java b/tests/src/cgeo/geocaching/cgBaseTest.java index d0a7b98..eedaa83 100644 --- a/tests/src/cgeo/geocaching/cgBaseTest.java +++ b/tests/src/cgeo/geocaching/cgBaseTest.java @@ -57,8 +57,7 @@ public class cgBaseTest extends AbstractResourceInstrumentationTestCase { assertEquals(expected.isPremiumMembersOnly(), actual.isPremiumMembersOnly()); if (all) { - assertEquals(expected.getLatitude(), actual.getLatitude()); - assertEquals(expected.getLongitude(), actual.getLongitude()); + assertEquals(expected.getCoords(), actual.getCoords()); assertTrue(actual.isReliableLatLon()); assertEquals(expected.isOwn(), actual.isOwn()); assertEquals(expected.getOwnerReal(), actual.getOwnerReal()); diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 3754af1..3ca8460 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -7,7 +7,6 @@ import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.enumerations.WaypointType; import cgeo.geocaching.geopoint.Geopoint; -import cgeo.geocaching.geopoint.GeopointFormatter; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; @@ -117,8 +116,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { assertEquals(2.0f, cache.getDifficulty(), 0.01f); assertEquals(1.0f, cache.getTerrain(), 0.01f); final Geopoint refCoordinates = new Geopoint("N 49° 19.122", "E 008° 32.739"); - assertEquals(refCoordinates.format(GeopointFormatter.Format.LAT_DECMINUTE), cache.getLatitude()); - assertEquals(refCoordinates.format(GeopointFormatter.Format.LON_DECMINUTE), cache.getLongitude()); + assertEquals(refCoordinates, cache.getCoords()); assertEquals("vptsz", cache.getOwner()); assertEquals(CacheSize.SMALL, cache.getSize()); assertEquals(CacheType.MULTI, cache.getType()); diff --git a/tests/src/cgeo/geocaching/test/mock/MockedCache.java b/tests/src/cgeo/geocaching/test/mock/MockedCache.java index 61369ee..2c717a4 100644 --- a/tests/src/cgeo/geocaching/test/mock/MockedCache.java +++ b/tests/src/cgeo/geocaching/test/mock/MockedCache.java @@ -5,7 +5,6 @@ import cgeo.geocaching.cgImage; import cgeo.geocaching.cgTrackable; import cgeo.geocaching.connector.gc.GCConstants; import cgeo.geocaching.geopoint.Geopoint; -import cgeo.geocaching.geopoint.GeopointFormatter; import cgeo.geocaching.utils.BaseUtils; import org.apache.commons.lang3.StringUtils; @@ -75,16 +74,6 @@ public abstract class MockedCache implements ICache { } @Override - public String getLatitude() { - return coords.format(GeopointFormatter.Format.LAT_DECMINUTE); - } - - @Override - public String getLongitude() { - return coords.format(GeopointFormatter.Format.LON_DECMINUTE); - } - - @Override public boolean isArchived() { return false; } |
