Factor out some common dataset test methods.