Methods Summary |
---|
private void | runFailTest(java.lang.String value)Run a failure test. value should be invalid.
NonNegativeInteger oNonNegativeInteger = null;
try {
oNonNegativeInteger = new NonNegativeInteger(value);
}
catch (Exception e) { // catch the validation exception
}
// object is not iNstantiated on bad data value
assertNull("validation restriction failed [" +
value + "]. did not restrict bad value.", oNonNegativeInteger);
|
private void | runPassTest(java.lang.String value)Run a successful test. value should be valid.
NonNegativeInteger oNonNegativeInteger = null;
try {
oNonNegativeInteger = new NonNegativeInteger(value);
}
catch (Exception e) { // catch the validation exception
}
assertEquals("unsigned int not equal" +
value, oNonNegativeInteger.toString(), value);
|
public void | testBelowMinExclusive()Test that a number below MinInclusive fails
runFailTest("-1");
|
public void | testMinExclusive()Test that a number at MinInclusive succeeds
runPassTest("0");
|
public void | testNegativeValue()Test that a negative number fails
runFailTest("-123");
|
public void | testPositiveValue()Test that a positive value succeeeds
runPassTest("12345678901234567890");
|