Added tests for closing ContnentAssistant (#641)