Unit tests for event dispatcher

Added basic unit tests to ensure the event dispatcher’s operation.