Skip to content

Commit

Permalink
testGetView
Browse files Browse the repository at this point in the history
  • Loading branch information
SebaMutuku committed Jul 1, 2022
1 parent 6b0b5d2 commit a13857d
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class JsonFormActivityTest extends BaseActivityTest {
@Mock
private Context context;
private Intent intent;
private Form form;

@Before
public void setUp() throws JSONException {
Expand Down Expand Up @@ -603,4 +604,17 @@ public void testUpdateUIByConstraintsOfRadioButton() throws Exception {
Whitebox.invokeMethod(activity, "updateUiByConstraints", view, true, errorMessage);
assertNotNull(view.getTag(R.id.key));
}

@Test
public void testGetView() throws Exception {
View view = Mockito.mock(View.class);
String key = "key";
String childKey = "childKey";
JsonFormActivity jsonFormActivity = Mockito.mock(JsonFormActivity.class);
Mockito.doReturn(childKey).when(view).getTag(R.id.childKey);
Mockito.doReturn(key).when(view).getTag(R.id.key);
String returnKey = Whitebox.invokeMethod(jsonFormActivity, "getViewKey", view);
assertEquals(key+":"+childKey,returnKey);

}
}

0 comments on commit a13857d

Please sign in to comment.