You can wrap it in try catch and assert you don't get into the catch.