Search in sources :

Example 1 with Arguments

use of com.facebook.react.bridge.Arguments in project react-native-navigation by wix.

the class ColorParseTest method shouldParsePlatformColors.

@Test
public void shouldParsePlatformColors() throws JSONException {
    JSONObject color = new JSONObject();
    final JSONArray jsonArray = new JSONArray();
    jsonArray.put("@color/colorPrimary");
    color.put("resource_paths", jsonArray);
    try (MockedStatic<Arguments> theMock = Mockito.mockStatic(Arguments.class)) {
        theMock.when(Arguments::createMap).thenReturn(new JavaOnlyMap());
        theMock.when(Arguments::createArray).thenReturn(new JavaOnlyArray());
        assertThat(ColorParser.parse(activity, color, "color")).isInstanceOf(ReactPlatformColor.class);
    }
}
Also used : JSONObject(org.json.JSONObject) JavaOnlyMap(com.facebook.react.bridge.JavaOnlyMap) JSONArray(org.json.JSONArray) Arguments(com.facebook.react.bridge.Arguments) JavaOnlyArray(com.facebook.react.bridge.JavaOnlyArray) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

Arguments (com.facebook.react.bridge.Arguments)1 JavaOnlyArray (com.facebook.react.bridge.JavaOnlyArray)1 JavaOnlyMap (com.facebook.react.bridge.JavaOnlyMap)1 BaseTest (com.reactnativenavigation.BaseTest)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1