Unit testing

Implemented unit testing.