diff options
author | Osana Babayan <32496536+osana@users.noreply.github.com> | 2017-12-21 16:04:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-21 16:04:26 -0500 |
commit | 28a21f3b0bb118224dcbe87b017ce74b7a7fab11 (patch) | |
tree | 77a1afe8defe772c235748b2b480691e9a63ffd0 /platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java | |
parent | c2250e6e53fcd7eda06250394bbda72c580e0c09 (diff) | |
download | qtlocation-mapboxgl-28a21f3b0bb118224dcbe87b017ce74b7a7fab11.tar.gz |
LatLng.wrap should return a new instance of LatLng (#10769)
LatLng.wrap shoudl wrap mulpiples of max value to max
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java index 06e93b9d2f..8e47f069c3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngTest.java @@ -12,6 +12,7 @@ import org.junit.rules.ExpectedException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -255,8 +256,17 @@ public class LatLngTest { @Test public void testWrapped() { - LatLng latLng = new LatLng(45.0, -185.0).wrap(); - assertEquals("longitude wrapped value", latLng.getLongitude(), 175.0, DELTA); + LatLng originalLatLng = new LatLng(45.0, -185.0); + LatLng newLatlng = originalLatLng.wrap(); + assertNotSame(" new wrapped LatLng is created", originalLatLng, newLatlng); + assertEquals("longitude wrapped value", originalLatLng.getLongitude(), -185.0, DELTA); + assertEquals("longitude wrapped value", newLatlng.getLongitude(), 175.0, DELTA); + + newLatlng = new LatLng(45.0, 180.0).wrap(); + assertEquals("longitude wrapped max value", newLatlng.getLongitude(), 180.0, DELTA); + + newLatlng = new LatLng(45.0, -180.0).wrap(); + assertEquals("longitude wrapped min value", newLatlng.getLongitude(), -180.0, DELTA); } @Test |