Пример #1
0
 @Test(expected = IllegalArgumentException.class)
 public void testOfOverScaledValue() throws Exception {
   MutableMoney.of(BigDecimal.valueOf(10.9282));
 }
Пример #2
0
 @Test
 public void testEquals() throws Exception {
   assertEquals(MutableMoney.of(2, 50), MutableMoney.of(BigDecimal.valueOf(2.5)));
   assertEquals(MutableMoney.of(2, 56), MutableMoney.of(BigDecimal.valueOf(2.56)));
 }
Пример #3
0
 @Test
 public void testOf() throws Exception {
   assertEquals("1,23", MutableMoney.of(1, 23).toString());
   assertEquals("1,23", MutableMoney.of(BigDecimal.valueOf(123, 2)).toString());
 }