Added a unit test to ScopedEventHandler.