Add some unit tests for query