JUnit使用BigDecimal断言 [英] JUnit Assert with BigDecimal
本文介绍了JUnit使用BigDecimal断言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用2到小数点后两位之间的断言,我使用这个:
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.assertSame (bd1,bd2);
但是JUnit日志显示:
but the JUnit log shows:
expected <1000> was not: <1000>
推荐答案
查看全文