Test for correct exception messages in test cases