Skip to content

Commit

Permalink
add null check test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansi-mParticle committed Aug 9, 2024
1 parent 6934002 commit 2c9210e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,15 @@ class KitConfigurationTest {
Assert.assertEquals(0, result.size())
}

@Test
fun testConvertToSparseArray_When_JSON_IS_NULL() {
val kitConfiguration = MockKitConfiguration()
val method: Method = MockKitConfiguration::class.java.getDeclaredMethod("convertToSparseArray", JSONObject::class.java)
method.isAccessible = true
val result = method.invoke(kitConfiguration, null) as SparseBooleanArray
Assert.assertEquals(0, result.size())
}

@Test
fun testConvertToSparseArray_When_JSON_Data_IS_INVALID() {
val kitConfiguration = MockKitConfiguration()
Expand Down

0 comments on commit 2c9210e

Please sign in to comment.