Move common testing code to base class