Skip to content

Commit 13bb8af

Browse files
committed
test queryJSON calls with null params
1 parent 181cebb commit 13bb8af

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.wordpress.android.util;
2+
3+
import android.test.InstrumentationTestCase;
4+
5+
import org.json.JSONArray;
6+
import org.json.JSONObject;
7+
8+
public class JSONUtilsTest extends InstrumentationTestCase {
9+
public void testQueryJSONNullSource1() {
10+
JSONUtils.queryJSON((JSONObject) null, "", "");
11+
}
12+
13+
public void testQueryJSONNullSource2() {
14+
JSONUtils.queryJSON((JSONArray) null, "", "");
15+
}
16+
17+
public void testQueryJSONNullQuery1() {
18+
JSONUtils.queryJSON(new JSONObject(), null, "");
19+
}
20+
21+
public void testQueryJSONNullQuery2() {
22+
JSONUtils.queryJSON(new JSONArray(), null, "");
23+
}
24+
25+
public void testQueryJSONNullReturnValue1() {
26+
JSONUtils.queryJSON(new JSONObject(), "", null);
27+
}
28+
29+
public void testQueryJSONNullReturnValue2() {
30+
JSONUtils.queryJSON(new JSONArray(), "", null);
31+
}
32+
}

0 commit comments

Comments
 (0)