Add a basic unit test and a functional test