MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / testDecimals

Method testDecimals

src/test/java/com/amazon/ion/DecimalTest.java:118–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116 }
117
118 @Test
119 public void testDecimals()
120 {
121 IonDecimal value = (IonDecimal) oneValue("1.0");
122 assertSame(IonType.DECIMAL, value.getType());
123 assertFalse(value.isNullValue());
124 assertArrayEquals(new String[0], value.getTypeAnnotations());
125 assertEquals(1.0F, value.floatValue());
126 assertEquals(1.0D, value.doubleValue());
127
128 assertEquals(new BigDecimal(1).setScale(1), value.bigDecimalValue());
129 // TODO more...
130
131 value = (IonDecimal) oneValue("a::1.0");
132 assertFalse(value.isNullValue());
133 checkAnnotation("a", value);
134
135 // Ensure that annotation makes it through value mods
136 modifyDecimal(value);
137 checkAnnotation("a", value);
138 }
139
140 @Test
141 public void testDFormat()

Callers

nothing calls this directly

Calls 10

floatValueMethod · 0.95
doubleValueMethod · 0.95
bigDecimalValueMethod · 0.95
modifyDecimalMethod · 0.95
getTypeMethod · 0.65
isNullValueMethod · 0.65
getTypeAnnotationsMethod · 0.65
oneValueMethod · 0.45
assertEqualsMethod · 0.45
checkAnnotationMethod · 0.45

Tested by

no test coverage detected