[android] - bring back style loading test to native map, add onDestroy to after test

This commit is contained in:
tobrun
2019-02-14 16:38:19 +02:00
committed by Tobrun
parent a471d896e9
commit 8d31a5a7e2

View File

@@ -13,6 +13,7 @@ import com.mapbox.mapboxsdk.maps.renderer.MapRenderer
import com.mapbox.mapboxsdk.style.layers.TransitionOptions
import com.mapbox.mapboxsdk.testapp.utils.TestConstants
import junit.framework.Assert.*
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -41,6 +42,30 @@ class NativeMapViewTest {
nativeMapView.resizeView(WIDTH, HEIGHT)
}
@After
@UiThreadTest
fun after() {
nativeMapView.destroy()
}
@Test
@UiThreadTest
fun testSetStyleUrl() {
val expected = Style.DARK
nativeMapView.styleUrl = expected
val actual = nativeMapView.styleUrl
assertEquals("Style URL should match", expected, actual)
}
@Test
@UiThreadTest
fun testSetStyleJson() {
val expected = "{}"
nativeMapView.styleJson = expected
val actual = nativeMapView.styleJson
assertEquals("Style JSON should match", expected, actual)
}
@Test
@UiThreadTest
fun testBearing() {