use of ddf.catalog.validation.impl.validator.RangeValidator in project ddf by codice.
the class RangeValidatorTest method testEqualsSelf.
@Test
public void testEqualsSelf() {
final RangeValidator validator = new RangeValidator(new BigDecimal("1.5"), new BigDecimal("2.5"));
assertThat(validator.equals(validator), is(true));
}
use of ddf.catalog.validation.impl.validator.RangeValidator in project ddf by codice.
the class RangeValidatorTest method testHashCode.
@Test
public void testHashCode() {
final RangeValidator validator1 = new RangeValidator(new BigDecimal("1.5"), new BigDecimal("2.5"));
final RangeValidator validator2 = new RangeValidator(new BigDecimal("1.5"), new BigDecimal("2.5"));
assertThat(validator1.hashCode(), is(validator2.hashCode()));
}
use of ddf.catalog.validation.impl.validator.RangeValidator in project ddf by codice.
the class RangeValidatorTest method testHashCodeDifferentMax.
@Test
public void testHashCodeDifferentMax() {
final RangeValidator validator1 = new RangeValidator(new BigDecimal("1.5"), new BigDecimal("2.5"));
final RangeValidator validator2 = new RangeValidator(new BigDecimal("1.5"), new BigDecimal("2.1"));
assertThat(validator1.hashCode(), not(validator2.hashCode()));
}
use of ddf.catalog.validation.impl.validator.RangeValidator in project ddf by codice.
the class RangeValidatorTest method testWithinSmallDecimalRange.
@Test
public void testWithinSmallDecimalRange() {
final RangeValidator validator = new RangeValidator(new BigDecimal("1.2457515"), new BigDecimal("1.2487595"), new BigDecimal("1E-7"));
validateNoErrors(new AttributeImpl("", 1.2457515), validator);
validateNoErrors(new AttributeImpl("", 1.2487595), validator);
validateNoErrors(new AttributeImpl("", 1.246), validator);
}
Aggregations