[android] #4018 - migrated max/min zoom to UiSettings + added tests + update sample app

This commit is contained in:
Tobrun
2016-02-18 16:25:19 +01:00
parent 27ed15c18c
commit 9ec0103431
6 changed files with 130 additions and 90 deletions

View File

@@ -21,6 +21,30 @@ public class UiSettingsTest {
assertNotNull("uiSettings should not be null", uiSettings);
}
@Test
public void testMinZoom() {
double zoom = 10;
UiSettings uiSettings = new UiSettings(mMapView);
uiSettings.setMinZoom(zoom);
assertEquals("MinZoom should match", zoom, uiSettings.getMinZoom(), 0);
}
@Test
public void testMaxZoom() {
double zoom = 10;
UiSettings uiSettings = new UiSettings(mMapView);
uiSettings.setMaxZoom(zoom);
assertEquals("MaxZoom should match", zoom, uiSettings.getMaxZoom(), 0);
}
@Test
public void testInitialZoomLevels() {
//we are mocking MapView we expect a value of 0 to be returned
UiSettings uiSettings = new UiSettings(mMapView);
assertEquals("MaxZoom should match", 0, uiSettings.getMaxZoom(), 0);
assertEquals("MinZoom should match", 0, uiSettings.getMinZoom(), 0);
}
@Test
public void testCompassEnabled() {
UiSettings uiSettings = new UiSettings(mMapView);
@@ -204,7 +228,6 @@ public class UiSettingsTest {
assertEquals("Scroll gesture should be disabled", false, uiSettings.isScrollGesturesEnabled());
}
@Test
public void testInvalidate() {
UiSettings uiSettings = new UiSettings(mMapView);