Added tests to validate usage of exceptions