I'm having some troubles with testing in Android.
For each test I do, I have a common set of instructions to do before the test and after the test. So, the idea would be define a setUp()
and tearDown()
method.
So far so good. The problem is that, apparently, the tearDown()
method is not invoked when the test "fails" (that means when the tests throws an Exception
).
Is there a method that can be invoked when a test throws an Exception or a "tricky" way to do this?