Add tests for WebSocket protocol methods

Add tests for WebSocket protocol methods
Add a check in deleteMessage method to check the type of the response parameter
Code cleaning and removing unnecessary trailing spaces