MoreThanZeroCentchromanPillsSuppliedRule implements IRule { @Override public boolean apply(SafeMap reportFields) { return IntegerUtil.tryParse(reportFields.get(NUMBER_OF_CENTCHROMAN_PILLS_SUPPLIED_FIELD_NAME), 0) > 0; }  @Override boolean apply(SafeMap reportFields);  }
@Test public void shouldReturnFalseWhenNoCentchromanPillsAreSupplied() throws Exception { assertFalse(rule.apply(new SafeMap().put("numberOfCentchromanPillsDelivered", null))); assertFalse(rule.apply(new SafeMap().put("numberOfCentchromanPillsDelivered", ""))); }
@Test public void shouldReturnFalseWhenZeroCentchromanPillsAreSupplied() throws Exception { assertFalse(rule.apply(new SafeMap().put("numberOfCentchromanPillsDelivered", "0"))); }
@Test public void shouldReturnTrueWhenMoreThanZeroCentchromanPillsAreSupplied() throws Exception { assertTrue(rule.apply(new SafeMap().put("numberOfCentchromanPillsDelivered", "1"))); }