Added testing code for the RegisterForEvent API