blob: bac1154d62e5e60df0e8affdef649f85692e9f27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.mapbox.mapboxsdk.style.layers;
import com.mapbox.mapboxsdk.style.functions.Function;
import org.junit.Test;
import static com.mapbox.mapboxsdk.style.functions.Function.zoom;
import static com.mapbox.mapboxsdk.style.functions.stops.Stop.stop;
import static com.mapbox.mapboxsdk.style.functions.stops.Stops.interval;
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineBlur;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertNotNull;
/**
* Tests Function
*/
public class FunctionTest {
@Test
public void testZoomFunction() {
Function<Float, Float> zoomF = zoom(interval(
stop(1f, lineBlur(1f)),
stop(10f, lineBlur(20f))
)
);
assertNotNull(zoomF.toValueObject());
assertArrayEquals(
new Object[] {new Object[] {1f, 1f}, new Object[] {10f, 20f}},
(Object[]) zoomF.toValueObject().get("stops")
);
}
}
|