Review Unit class

* Add 100% code coverage
* Add custom error code
* Linted source and test
* More descriptive test messages