@Test(expectedExceptions = ArithmeticException.class) public void shouldReturnErrorWhenLongValueExactMustBeTruncated() { NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.12)); numberValue.longValueExact(); }
@Test public void shouldReturnLongValueExact() { NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132)); assertEquals(numberValue.longValueExact(), 132L); }