Fork me on GitHub

Testability

Testing multi-threaded, loosly coupled systems is a big challenge. Therefore the event broker supports you by providing infrastructure to make execution of events always synchronous. There is no need for using signals or locks in your unit tests.

In your tests, simply create the event broker with the unit test factory:

This event broker will handle all events on the publisher thread. Therefore, when the unit tests finished execution, all handler methods were executed, too. There is no need to use signals to make sure that all code is executed before making any asserts.