modified the assert param for comparing actual and expected values
This commit is contained in:
parent
e60b86e5b1
commit
1ba588f717
|
@ -13,8 +13,8 @@ public class StringToBigDecimalConversionUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValidString_WhenBigDecimalObjectWithStringParameter_ThenResultIsDecimalObject() {
|
public void givenValidString_WhenBigDecimalObjectWithStringParameter_ThenResultIsDecimalObject() {
|
||||||
BigDecimal bigDecimal = new BigDecimal(123);
|
BigDecimal bigDecimal = new BigDecimal("123");
|
||||||
assertEquals(bigDecimal, new BigDecimal("123"));
|
assertEquals(new BigDecimal(123), bigDecimal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NullPointerException.class)
|
@Test(expected = NullPointerException.class)
|
||||||
|
@ -30,8 +30,8 @@ public class StringToBigDecimalConversionUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenValidString_WhenValueOfDoubleFromString_ThenResultIsDecimalObject() {
|
public void givenValidString_WhenValueOfDoubleFromString_ThenResultIsDecimalObject() {
|
||||||
BigDecimal bigDecimal = new BigDecimal(123.42).setScale(2, BigDecimal.ROUND_HALF_UP);
|
BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf("123.42"));
|
||||||
assertEquals(bigDecimal, BigDecimal.valueOf(Double.valueOf("123.42")));
|
assertEquals(new BigDecimal(123.42).setScale(2, BigDecimal.ROUND_HALF_UP), bigDecimal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NullPointerException.class)
|
@Test(expected = NullPointerException.class)
|
||||||
|
|
Loading…
Reference in New Issue