InterviewSolution
Saved Bookmarks
| 1. |
What does the fail() method do in JUnit?(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 secondI got this question in examination.My query is from Running Parameterized Tests in portion Exploring Core JUnit of JUnit |
|
Answer» CORRECT choice is (a) THROWS an ASSERTION error unconditionally To EXPLAIN I would say: 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. |
|