Methods Summary |
---|
private void | runFailTest(long value)Run a failure test. value should be invalid.
UnsignedByte oUnsignedByte = null;
try {
oUnsignedByte = new UnsignedByte(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.", oUnsignedByte);
|
private void | runPassTest(long value)Run a successful test. value should be valid.
UnsignedByte oUnsignedByte = null;
try {
oUnsignedByte = new UnsignedByte(value);
}
catch (Exception e) { // catch the validation exception
}
assertEquals("unsigned byte not equal" +
String.valueOf(value), oUnsignedByte.toString(), String.valueOf(value));
|
public void | testMaxInclusive()Test that a number at MaxInclusive succeeds
runPassTest(255);
|
public void | testMaxOver()Test that a number over MaxInclusive fails
runFailTest(256);
|
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);
|