JUnit Assert with BigDecimal

后端 未结 9 2210
遇见更好的自我
遇见更好的自我 2021-02-02 05:47

I want to use assert between 2 two decimal, I use this:

BigDecimal bd1 = new BigDecimal (1000);
BigDecimal bd2 = new BigDecimal (1000);
org.junit.Assert.assertSa         


        
9条回答
  •  我在风中等你
    2021-02-02 06:21

    Can't you just use a toString() as in :

    assertEquals("0.02", taxes.toString());
    

    where taxes is a BigDecimal.

提交回复
热议问题