Add unit tests for onenter and on exit blocks