Add unit tests.

Done