         listeningExpectation?.fulfill()
         XCTAssertTrue(socket.isListening, "Listening property should be set true")
         
-        socket.disconnect()
         
     }
     

    
    func testWatsonSockets() {
        
        connectionExpectation = expectationWithDescription("connection")
        listeningExpectation = expectationWithDescription("listening")
        messageExpectation = expectationWithDescription("receive message")
        disconnectExpectation = expectationWithDescription("disconnect")
        
        let data = NSData()
        
        socket.username = self.username
        socket.password = self.password
        socket.delegate = self
        
        socket.send(data)
        
        
        if let ws = socket.socket {
            XCTAssertTrue(ws.isConnected, "Web socket is not connected")
        }
        
        
        
        

        waitForExpectationsWithTimeout(timeout) {
            error in XCTAssertNil(error, "Timeout")
        }

        
    }
    
    func onMessageReceived(results: [SpeechToTextResult]) {
        
        Log.sharedLogger.info("Received: \(results)")
        // XCTAssertNotnil(results)
        messageExpectation?.fulfill()
        
        socket.disconnect()

    }
    
    func onConnected() {
