blob: 694215d16fc5b45ceb4688ee8643c1665d337a01 (
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
35
36
37
38
39
40
41
42
43
|
package com.mapbox.mapboxsdk.utils;
import android.support.test.runner.AndroidJUnit4;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@RunWith(AndroidJUnit4.class)
public class FontUtilsTest {
@Test
public void testExtractedFontShouldMatchDefault() {
String[] fonts = new String[] {"foo", "bar"};
String actual = FontUtils.extractValidFont(fonts);
assertEquals("Selected font should match", MapboxConstants.DEFAULT_FONT, actual);
}
@Test
public void testExtractedFontShouldMatchMonospace() {
String expected = "monospace";
String[] fonts = new String[] {"foo", expected};
String actual = FontUtils.extractValidFont(fonts);
assertEquals("Selected font should match", expected, actual);
}
@Test
public void testExtractedFontArrayShouldBeNull() {
String[] fonts = null;
String actual = FontUtils.extractValidFont(fonts);
assertNull(actual);
}
@Test
public void testExtractedFontShouldBeNull() {
String actual = FontUtils.extractValidFont(null);
assertNull(actual);
}
}
|