Consolidate test code that looks up methods by name.