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