Add tests for case functions