'Fake L{IReactorCore.run}.
Sets C{self.running} to L{True}, runs all of the hooks passed to
C{self.callWhenRunning}, then calls C{self.stop} to simulate a request
to stop the reactor.
Sets C{self.hasRun} to L{True}.'

def run(self):

    assert (self.running is False)
    self.running = True
    self.hasRun = True
    for (f, args, kwargs) in self.whenRunningHooks:
        f(*args, **kwargs)
    self.stop()
