[android] - move min/max zoom to transform class, cleanup usage of double vs float, renaming for parity (#7306)

This commit is contained in:
Tobrun
2016-12-15 16:57:30 +01:00
committed by GitHub
parent 13e7672f85
commit f95b4838ea
12 changed files with 93 additions and 77 deletions

View File

@@ -7,7 +7,6 @@ import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.utils.MockParcel;
import org.junit.Test;
@@ -22,6 +21,8 @@ import static org.junit.Assert.assertTrue;
public class MapboxMapOptionsTest {
private static final double DELTA = 1e-15;
@Test
public void testSanity() {
assertNotNull("should not be null", new MapboxMapOptions());
@@ -99,16 +100,16 @@ public class MapboxMapOptionsTest {
@Test
public void testMinZoom() {
assertEquals(MapboxConstants.MINIMUM_ZOOM, new MapboxMapOptions().getMinZoom());
assertEquals(5.0f, new MapboxMapOptions().minZoom(5.0f).getMinZoom());
assertNotEquals(2.0f, new MapboxMapOptions().minZoom(5.0f).getMinZoom());
assertEquals(MapboxConstants.MINIMUM_ZOOM, new MapboxMapOptions().getMinZoomPreference(), DELTA);
assertEquals(5.0f, new MapboxMapOptions().minZoomPreference(5.0f).getMinZoomPreference(), DELTA);
assertNotEquals(2.0f, new MapboxMapOptions().minZoomPreference(5.0f).getMinZoomPreference(), DELTA);
}
@Test
public void testMaxZoom() {
assertEquals(MapboxConstants.MAXIMUM_ZOOM, new MapboxMapOptions().getMaxZoom());
assertEquals(5.0f, new MapboxMapOptions().maxZoom(5.0f).getMaxZoom());
assertNotEquals(2.0f, new MapboxMapOptions().maxZoom(5.0f).getMaxZoom());
assertEquals(MapboxConstants.MAXIMUM_ZOOM, new MapboxMapOptions().getMaxZoomPreference(), DELTA);
assertEquals(5.0f, new MapboxMapOptions().maxZoomPreference(5.0f).getMaxZoomPreference(), DELTA);
assertNotEquals(2.0f, new MapboxMapOptions().maxZoomPreference(5.0f).getMaxZoomPreference(), DELTA);
}
@Test