Added unit tests.

Signed-off-by: Alexander Peev <peev.alexander@gmail.com>