@Test public void checkIntDef_whenValueIsCorrect_shouldProduceNoErrors() { BaseValidator.ValidationContext context = BaseValidator.getValidationContext(String.class); assertThat(BaseValidator.checkIntDef(context, 10, false, 10).isEmpty()); }
@Test public void checkIntDef_whenValueMatchesSet_shouldProduceNoErrors() { BaseValidator.ValidationContext context = BaseValidator.getValidationContext(String.class); assertThat(BaseValidator.checkIntDef(context, 10, false, 10, 11, 12, 13).isEmpty()); }
@Test public void checkIntDef_whenValueDoesNotMatch_shouldProduceError() { BaseValidator.ValidationContext context = BaseValidator.getValidationContext(String.class); List<RaveError> errors = BaseValidator.checkIntDef(context, 9, false, 10, 11, 12, 13); assertThat(errors).isNotEmpty(); assertThat(errors).hasSize(1); RaveError error = errors.get(0); assertThat(error.getErrorMsg()).contains(RaveErrorStrings.INT_DEF_ERROR); }