Add unit tests for ca_code