add unit tests for connection opening and closing