Add some unit tests for the main ctrl