@@ -13,49 +13,49 @@ public class QuantityFormatterTest {
13
13
public void testParsePlain () {
14
14
final Quantity quantity = new QuantityFormatter ().parse ("1" );
15
15
assertThat (quantity .getFormat (), is (Quantity .Format .DECIMAL_SI ));
16
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (1 )));
16
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (1 )));
17
17
}
18
18
19
19
@ Test
20
20
public void testParseFractional () {
21
21
final Quantity quantity = new QuantityFormatter ().parse ("0.001" );
22
22
assertThat (quantity .getFormat (), is (Quantity .Format .DECIMAL_SI ));
23
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (0.001 )));
23
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (0.001 )));
24
24
}
25
25
26
26
@ Test
27
27
public void testParseFractionalUnit () {
28
28
final Quantity quantity = new QuantityFormatter ().parse ("0.001m" );
29
29
assertThat (quantity .getFormat (), is (Quantity .Format .DECIMAL_SI ));
30
- assertThat (quantity .getBigDecimal (), is (new BigDecimal ("0.000001" )));
30
+ assertThat (quantity .getNumber (), is (new BigDecimal ("0.000001" )));
31
31
}
32
32
33
33
@ Test
34
34
public void testParseBinarySi () {
35
35
final Quantity quantity = new QuantityFormatter ().parse ("1Ki" );
36
36
assertThat (quantity .getFormat (), is (Quantity .Format .BINARY_SI ));
37
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (1024 )));
37
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (1024 )));
38
38
}
39
39
40
40
@ Test
41
41
public void testParseLargeNumeratorBinarySi () {
42
42
final Quantity quantity = new QuantityFormatter ().parse ("32Mi" );
43
43
assertThat (quantity .getFormat (), is (Quantity .Format .BINARY_SI ));
44
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (2 ).pow (20 ).multiply (BigDecimal .valueOf (32 ))));
44
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (2 ).pow (20 ).multiply (BigDecimal .valueOf (32 ))));
45
45
}
46
46
47
47
@ Test
48
48
public void testParseExponent () {
49
49
final Quantity quantity = new QuantityFormatter ().parse ("1e3" );
50
50
assertThat (quantity .getFormat (), is (Quantity .Format .DECIMAL_EXPONENT ));
51
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (1000 )));
51
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (1000 )));
52
52
}
53
53
54
54
@ Test
55
55
public void testParseNegativeExponent () {
56
56
final Quantity quantity = new QuantityFormatter ().parse ("1e-3" );
57
57
assertThat (quantity .getFormat (), is (Quantity .Format .DECIMAL_EXPONENT ));
58
- assertThat (quantity .getBigDecimal (), is (BigDecimal .valueOf (0.001 )));
58
+ assertThat (quantity .getNumber (), is (BigDecimal .valueOf (0.001 )));
59
59
}
60
60
61
61
@ Test (expected = QuantityFormatException .class )
0 commit comments