Unit tests for `register` and `unregister`.