Add tests for exercise close/reopen behaviour