[android] #4487 - ArraysInOfBoundsException fix for addMarkers

This commit is contained in:
Tobrun
2016-03-29 09:16:02 +02:00
committed by Brad Leege
parent 9a556bf24a
commit f8b6e1f7da
2 changed files with 46 additions and 22 deletions

View File

@@ -534,6 +534,23 @@ public class MapboxMapTest {
assertTrue(mMapboxMap.getMarkers().contains(markerOptions2.getMarker()));
}
@Test
public void testAddMarkersEmpty() {
List<MarkerOptions> markerList = new ArrayList<>();
mMapboxMap.addMarkers(markerList);
assertEquals("Markers size should be 0", 0, mMapboxMap.getMarkers().size());
}
@Test
public void testAddMarkersSingleMarker() {
List<MarkerOptions> markerList = new ArrayList<>();
MarkerOptions markerOptions = new MarkerOptions().title("a");
markerList.add(markerOptions);
mMapboxMap.addMarkers(markerList);
assertEquals("Markers size should be 1", 1, mMapboxMap.getMarkers().size());
assertTrue(mMapboxMap.getMarkers().contains(markerOptions.getMarker()));
}
@Test
public void testAddPolygon() {
PolygonOptions polygonOptions = new PolygonOptions().add(new LatLng());