diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/test/java/CoordinateRegionTest.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/test/java/CoordinateRegionTest.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/CoordinateRegionTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/CoordinateRegionTest.java new file mode 100644 index 0000000000..4690bd719b --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/CoordinateRegionTest.java @@ -0,0 +1,54 @@ +import com.mapbox.mapboxsdk.geometry.CoordinateRegion; +import com.mapbox.mapboxsdk.geometry.CoordinateSpan; +import com.mapbox.mapboxsdk.geometry.LatLng; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class CoordinateRegionTest { + + @Test + public void testSanity() { + LatLng center = new LatLng(1.2, 3.4, 5.6); + CoordinateSpan span = new CoordinateSpan(9.8, 7.6); + CoordinateRegion coordinateRegion = new CoordinateRegion(center, span); + assertNotNull("coordinateRegion should not be null", coordinateRegion); + } + + @Test + public void testCenterConstructor() { + LatLng center = new LatLng(1.2, 3.4, 5.6); + CoordinateSpan span = new CoordinateSpan(9.8, 7.6); + CoordinateRegion coordinateRegion = new CoordinateRegion(center, span); + assertEquals("center should match", coordinateRegion.getCenter(), center); + } + + @Test + public void testSpanConstructor() { + LatLng center = new LatLng(1.2, 3.4, 5.6); + CoordinateSpan span = new CoordinateSpan(9.8, 7.6); + CoordinateRegion coordinateRegion = new CoordinateRegion(center, span); + assertEquals("span should match", coordinateRegion.getSpan(), span); + } + + @Test + public void testCenterMethod() { + LatLng center = new LatLng(1.2, 3.4, 5.6); + CoordinateSpan span = new CoordinateSpan(9.8, 7.6); + CoordinateRegion coordinateRegion = new CoordinateRegion(null, span); + coordinateRegion.setCenter(center); + assertEquals("center should match", coordinateRegion.getCenter(), center); + } + + @Test + public void testSpanMethod() { + LatLng center = new LatLng(1.2, 3.4, 5.6); + CoordinateSpan span = new CoordinateSpan(9.8, 7.6); + CoordinateRegion coordinateRegion = new CoordinateRegion(center, null); + coordinateRegion.setSpan(span); + assertEquals("span should match", coordinateRegion.getSpan(), span); + } + +} |