Reduce code duplication in tests such as GenericSchedulerTest
There are several test cases in our codebase which could profit from less code duplication and could be made much smaller and easier to parse.
For example, the file GenericSchedulerTest.cpp
and also other places.