Add unit tests.

Done.