added tests for name-based query function generation.