Update error messages to use the built in assertEquals

This commit is contained in:
John J. Aylward 2020-07-20 18:25:22 -04:00
parent 6ddaa13c1e
commit 734f182242

View File

@ -103,20 +103,18 @@ public class Util {
*/ */
if (!(value instanceof Number && expectedValue instanceof Number)) { if (!(value instanceof Number && expectedValue instanceof Number)) {
// Non-Number and non-matching types // Non-Number and non-matching types
assertTrue("object types should be equal for actual: "+ assertEquals("object types should be equal ",
value.toString()+" ("+ expectedValue.getClass().toString(),
value.getClass().toString()+") expected: "+ value.getClass().toString()
expectedValue.toString()+" ("+ );
expectedValue.getClass().toString()+")",
value.getClass().toString().equals(
expectedValue.getClass().toString()));
} }
/** /**
* Same types or both Numbers, compare by toString() * Same types or both Numbers, compare by toString()
*/ */
assertTrue("string values should be equal for actual: "+ assertEquals("values should be equal",
value.toString()+" expected: "+expectedValue.toString(), expectedValue.toString(),
value.toString().equals(expectedValue.toString())); value.toString()
);
} }
} }
} }