ActionProfileSwitchPercent extends Action { @Override public String shortDescription() { if (duration.getMinutes() == 0) return MainApp.gs(R.string.startprofileforever, (int) pct.getValue()); else return MainApp.gs(R.string.startprofile, (int) pct.getValue(), duration.getMinutes()); } ActionProfileSwitchPercent(); @Override int friendlyName(); @Override String shortDescription(); @Override void doAction(Callback callback); @Override void generateDialog(LinearLayout root); @Override boolean hasDialog(); @Override String toJSON(); @Override Action fromJSON(String data); @Override Optional<Integer> icon();  }
@Test public void shortDescriptionTest() { actionProfileSwitchPercent = new ActionProfileSwitchPercent(); actionProfileSwitchPercent.pct = new InputPercent().setValue(100); actionProfileSwitchPercent.duration = new InputDuration(30, InputDuration.TimeUnit.MINUTES); Assert.assertNull(actionProfileSwitchPercent.shortDescription()); }