Added test for exception factory.