arther/Library-Management-System — Issue #2: Testing for exceptions
Author: sudhirj
Created: 2011-12-16 05:10:24+00:00
State: open

Code like this is unnecessary:

@Test
public void shouldNotCreateObjectWithEmptyArguments(){
boolean flag = false;
try {
Movie movie = new Movie("","");
} catch (RuntimeException e) {
flag = true;
}
assertTrue(flag);
}}

There are far better ways to test that an exception is supposed to be thrown. Find them...