Can you throw an InvalidArgumentException or something, and check for that instead? This could also be an error in the test itself and you wouldn't notice