Wraps tasks (selected by name) in such a way that the mock service is started before them, and stopped after them.