Templatize projection tests to avoid code duplication.