public class ValidatedDoubleTest extends TestCase {
public void testSetValue() throws ValidationException {
double value = 200;
ValidatedDouble validatedDouble = new ValidatedDouble();
validatedDouble.setValue(value);
assertTrue(validatedDouble.getValue() == value);
validatedDouble.addConstraint(new ValidatedDoubleMinMaxConstraint(10, 100));
validatedDouble.setValue(10);
try {
validatedDouble.setValue(101);
fail("This should throw an ValidationException!");
} catch (ValidationException e) {
// ok
}
}