Sail E0 Webinar
Question
What does the fail() method do in JUnit?
Options:
A .  Throws an assertion error unconditionally
B .  Calls the default constructor
C .  Outputs the message Fail" to the console
D .  Pauses the test for 1 second
Answer: Option A


The method throws an assertion error unconditionally. This might be helpful to show an incomplete test (maybe still being worked upon) or to ensure that an expected exception is thrown.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers