Added some unit tests for event functions