In tutorial for testing android have found the method fail() which is from Asserts. So in which scenario this method could be useful?
Asked
Active
Viewed 35 times
0
-
For example, when an exception is triggered. – cesarmarch Jun 17 '19 at 17:04
-
@cesarmarch could you give example of the test for that? – Bo Z Jun 17 '19 at 17:08
-
complicated boolean if(a&&b||c||d&&e) fail("oops"); – Ray Tayek Jun 17 '19 at 20:26
-
Possible duplicate of [What's the actual use of 'fail' in JUnit test case?](https://stackoverflow.com/questions/3869954/whats-the-actual-use-of-fail-in-junit-test-case) – Dirk Herrmann Jun 19 '19 at 21:59