【发布时间】:2014-12-02 18:28:45
【问题描述】:
我是 JUnit 和 Hamcrest 的新手,希望获得最佳实践建议,以便我可以决定首先研究哪些文档。
对于初学者,assertThat 方法中哪个更好?
- org.junit.Assert.assertThat(来自 junit-4.11.jar)
- org.hamcrest.MatcherAssert.assertThat(来自 hamcrest-core-1.3.jar)
据今年早些时候有人说,Hamcrest "could potentially give better error messages because the matcher is called to describe the mismatch"。
很难说这些帖子中比较了哪些版本的 Junit 和 Hamcrest。因此,我想要一个基于最新发布版本的建议。
【问题讨论】: