Refactor InvokeEventHandler test