I\'m attempting to write some tests using the built-in android Junit testing framework. I am running into a problem with a test where I am expecting an exception to be thrown.
The standard junit 3 idiom for this sort of test was:
public void testThatMethodThrowsException() { try { doSomethingThatShouldThrow(); Assert.fail("Should have thrown Arithmetic exception"); } catch(ArithmeticException e) { //success } }