Methods Summary |
---|
private void | runFailTest(long value)Run a failure test. value should be invalid.
UnsignedInt oUnsignedInt = null;
try {
oUnsignedInt = new UnsignedInt(value);
}
catch (Exception e) { // catch the validation exception
}
// object is not iNstantiated on bad data value
assertNull("validation restriction failed [" +
String.valueOf(value) + "]. did not restrict bad value.", oUnsignedInt);
|
private void | runPassTest(long value)Run a successful test. value should be valid.
UnsignedInt oUnsignedInt = null;
try {
oUnsignedInt = new UnsignedInt(value);
}
catch (Exception e) { // catch the validation exception
}
assertEquals("unsigned int not equal" +
String.valueOf(value), oUnsignedInt.toString(), String.valueOf(value));
|
public void | testMaxInclusive()Test that a number at MaxInclusive succeeds
runPassTest(4294967295L);
|
public void | testMaxOver()Test that a number over MaxInclusive fails
runFailTest(4294967296L);
|
public void | testMinExclusive()Test that a number at MinInclusive succeeds
runPassTest(0L);
|
public void | testNegativeValue()Test that a negative number fails
runFailTest(-100);
|
public void | testPositiveValue()Test that a positive value succeeeds
runPassTest(100);
|