Refactor EventManagerTest code