PtvProgramPresenter extends Presenter { public boolean isNotSubmittedForApproval() { return ptvProgram.getCreatedBy() != null && (ptvProgram.getStatus().equals(ViaReportStatus.DRAFT) || ptvProgram.getStatus().equals(ViaReportStatus.MISSING)) && ptvProgram.getCreatedBy().isEmpty(); } PtvProgramPresenter(); @Override void attachView(BaseView v); Observable<PTVProgram> buildInitialPtvProgram(); Observable<PTVProgram> savePTVProgram(final boolean isCompleted); PTVProgram updatePTVProgram(String totalWoman, String totalChild); void buildPlaceholderRows(); boolean isNotSubmittedForApproval(); Observable<PTVProgram> signReport(String signature, boolean isComplete);  }
@Test public void shouldReturnTrueWhenPTVProgramDoesNotHaveCreatedByFieldFilled() throws LMISException { ptvProgram = createInitialPTVProgram(); boolean isNotSubmittedForApproval = ptvProgramPresenter.isNotSubmittedForApproval(); assertThat(true, is(isNotSubmittedForApproval)); }
@Test public void shouldReturnTrueWhenStatusIsMissingOrDraftAndCreatedByFieldIsNotFilled() throws LMISException { ptvProgram = createInitialPTVProgram(); ptvProgram.setStatus(ViaReportStatus.DRAFT); boolean isNotSubmittedForApproval = ptvProgramPresenter.isNotSubmittedForApproval(); assertThat(true, is(isNotSubmittedForApproval)); }
@Test public void shouldReturnFalseWhenStatusIsNotMissingOrDraft() throws LMISException { ptvProgram = createInitialPTVProgram(); ptvProgram.setStatus(ViaReportStatus.SUBMITTED); boolean isNotSubmittedForApproval = ptvProgramPresenter.isNotSubmittedForApproval(); assertThat(false, is(isNotSubmittedForApproval)); }
@Test public void shouldReturnFalseWhenCreatedByFieldIsNotEmpty() throws LMISException { ptvProgram = createInitialPTVProgram(); ptvProgram.setCreatedBy("TWUIO"); boolean isNotSubmittedForApproval = ptvProgramPresenter.isNotSubmittedForApproval(); assertThat(false, is(isNotSubmittedForApproval)); }