This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] MapboxMap.animate() and Mapbox.easeCamera() should throw Il…
…legalArgument if non-positive duration is passed in
- Loading branch information
Osana Babayan
authored and
“osana”
committed
Oct 30, 2017
1 parent
484c04a
commit ca1282e
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...orm/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapboxMapTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.mapbox.mapboxsdk.maps; | ||
|
||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; | ||
import com.mapbox.mapboxsdk.geometry.LatLng; | ||
import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static org.mockito.Mockito.mock; | ||
|
||
public class MapboxMapTest { | ||
|
||
private MapboxMap mapboxMap; | ||
|
||
@Before | ||
public void beforeTest() { | ||
|
||
mapboxMap = new MapboxMap(mock(NativeMapView.class), | ||
mock(Transform.class), | ||
mock(UiSettings.class), | ||
mock(TrackingSettings.class), | ||
mock(MyLocationViewSettings.class), | ||
mock(Projection.class), | ||
mock(MapboxMap.OnRegisterTouchListener.class), | ||
mock(AnnotationManager.class), | ||
mock(CameraChangeDispatcher.class)); | ||
} | ||
|
||
@Test(expected = IllegalArgumentException.class) | ||
public void testAnimateCameraChecksDurationPositive() { | ||
mapboxMap.animateCamera(CameraUpdateFactory.newLatLng(new LatLng(30.0, 30.0)), | ||
0, null); | ||
} | ||
|
||
@Test(expected = IllegalArgumentException.class) | ||
public void testEaseCameraChecksDurationPositive() { | ||
mapboxMap.easeCamera(CameraUpdateFactory.newLatLng(new LatLng(30.0, 30.0)), | ||
0, null); | ||
} | ||
|
||
@After | ||
public void afterTest() { | ||
mapboxMap = null; | ||
} | ||
} |