Start factoring out some common test code.