A1cCalculatorActivity extends AppCompatActivity { @SuppressWarnings("UnusedParameters") @OnEditorAction(R.id.activity_converter_a1c_glucose) boolean editorAction(TextView view, int actionId, KeyEvent event) { return actionId == EditorInfo.IME_ACTION_DONE; }  void setMmol(); @Override boolean onKeyUp(int keyCode, KeyEvent event); @Override boolean onKeyDown(int keyCode, KeyEvent event); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item);  }
@Test public void ReturnTrue_WhenKeyboardActionDone() throws Exception { assertThat(activity.editorAction(null, EditorInfo.IME_ACTION_DONE, null)).isTrue(); }
@Test public void ReturnFalse_WhenKeyboardActionOther() throws Exception { assertThat(activity.editorAction(null, EditorInfo.IME_ACTION_GO, null)).isFalse(); }