Using ExpectedException attribute for tests