added tests for query assembly.