本文翻译自:Why doesn't JUnit provide assertNotEquals methods?
Does anybody know why JUnit 4 provides assertEquals(foo,bar)
but not assertNotEqual(foo,bar)
methods? 有谁知道为什么JUnit 4提供assertEquals(foo,bar)
但不提供assertNotEqual(foo,bar)
方法?
It provides assertNotSame
(corresponding to assertSame
) and assertFalse
(corresponding to assertTrue
), so it seems strange that they didn't bother including assertNotEqual
. 它提供assertNotSame
(对应于assertSame
)和assertFalse
(对应于assertTrue
),所以它似乎很奇怪,他们没有打扰包括assertNotEqual
。
By the way, I know that JUnit-addons provides the methods I'm looking for.