Refactoring of unit tests to get out common code to test different task types.