added tests for events and the apply method