Java/ JUnit - AssertTrue vs AssertFalse

后端 未结 7 835
旧巷少年郎
旧巷少年郎 2020-12-23 09:28

I\'m pretty new to Java and am following the Eclipse Total Beginner\'s Tutorials. They are all very helpful, but in Lesson 12, he uses assertTrue for one test c

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-23 10:09

    Your understanding is incorrect, in cases like these always consult the JavaDoc.

    assertFalse

    public static void assertFalse(java.lang.String message,
                                   boolean condition)
    

    Asserts that a condition is false. If it isn't it throws an AssertionError with the given message.

    Parameters:

    • message - the identifying message for the AssertionError (null okay)
    • condition - condition to be checked

提交回复
热议问题