Updated method to add exception handling for testing assertions.
Added more assertion tests.