NumericOptionItem extends OptionItem { public NumericOptionItem setLabel(final String labelId) { if (labelId == null) { throw new IllegalArgumentException(getContext().getString(R.string.msdkui_exception_label_null)); } mLabelView.setText(labelId); return this; } NumericOptionItem(final Context context);  NumericOptionItem(final Context context, final AttributeSet attrs);  NumericOptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  NumericOptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); Number getValue(); NumericOptionItem setValue(final Number value); String getLabel(); NumericOptionItem setLabel(final String labelId); NumericOptionItem setInputType(int inputType);  }
@Test(expected = IllegalArgumentException.class) public void testSetNullLabelException() { mNumericOptionItem.setLabel(null); }
@Test public void testValueEditDialogNegative() { mNumericOptionItem.setLabel(getString(R.string.msdkui_violate_truck_options)); final TextView valueView = mNumericOptionItem.findViewById(R.id.numeric_item_value); assertNotNull(valueView); valueView.performClick(); AlertDialog alertDialog = (AlertDialog) ShadowDialog.getLatestDialog(); assertTrue(alertDialog.isShowing()); alertDialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick(); assertFalse(alertDialog.isShowing()); }