test handling of BeforeRegister, AfterRegister events.