@Test public void doActionTest() { actionStartTempTarget.doAction(new Callback() { @Override public void run() { } }); Assert.assertNotEquals(null, tempTargetAdded); }
@Override public void doAction(Callback callback) { tempTarget = new TempTarget() .date(DateUtil.now()) .duration(duration.getMinutes()) .reason(reason) .source(Source.USER) .low(Profile.toMgdl(value.getValue(), value.getUnits())) .high(Profile.toMgdl(value.getValue(), value.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); }
ActionStartTempTarget extends Action { @Override public void doAction(Callback callback) { tempTarget = new TempTarget() .date(DateUtil.now()) .duration(duration.getMinutes()) .reason(reason) .source(Source.USER) .low(Profile.toMgdl(value.getValue(), value.getUnits())) .high(Profile.toMgdl(value.getValue(), value.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } }
ActionStartTempTarget extends Action { @Override public void doAction(Callback callback) { tempTarget = new TempTarget() .date(DateUtil.now()) .duration(duration.getMinutes()) .reason(reason) .source(Source.USER) .low(Profile.toMgdl(value.getValue(), value.getUnits())) .high(Profile.toMgdl(value.getValue(), value.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } ActionStartTempTarget(); }
ActionStartTempTarget extends Action { @Override public void doAction(Callback callback) { tempTarget = new TempTarget() .date(DateUtil.now()) .duration(duration.getMinutes()) .reason(reason) .source(Source.USER) .low(Profile.toMgdl(value.getValue(), value.getUnits())) .high(Profile.toMgdl(value.getValue(), value.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } ActionStartTempTarget(); @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(); }
ActionStartTempTarget extends Action { @Override public void doAction(Callback callback) { tempTarget = new TempTarget() .date(DateUtil.now()) .duration(duration.getMinutes()) .reason(reason) .source(Source.USER) .low(Profile.toMgdl(value.getValue(), value.getUnits())) .high(Profile.toMgdl(value.getValue(), value.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); if (callback != null) callback.result(new PumpEnactResult().success(true).comment(R.string.ok)).run(); } ActionStartTempTarget(); @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();  }