assert vs. JUnit Assertions

前端 未结 6 980
难免孤独
难免孤独 2020-11-29 03:32

Today I saw a JUnit test case with a java assertion instead of the JUnit assertions—Are there significant advantages or disadvantages to prefer one over the other?

6条回答
  •  借酒劲吻你
    2020-11-29 04:01

    This may not apply if you exclusively use stuff that's shiny and new, but assert was not introduced into Java until 1.4SE. Therefore, if you must work in an environment with older technology, you may lean towards JUnit for compatibility reasons.

提交回复
热议问题