void TestQJsonRpcMessage::testMessageTypes() { QJsonRpcMessage invalid; QCOMPARE(invalid.type(), QJsonRpcMessage::Invalid); QJsonRpcMessage request = QJsonRpcMessage::createRequest("testMethod"); QCOMPARE(request.type(), QJsonRpcMessage::Request); QJsonRpcMessage response = request.createResponse("testResponse"); QCOMPARE(response.type(), QJsonRpcMessage::Response); QJsonRpcMessage error = request.createErrorResponse(QJsonRpc::NoError); QCOMPARE(error.type(), QJsonRpcMessage::Error); QJsonRpcMessage notification = QJsonRpcMessage::createNotification("testNotification"); QCOMPARE(notification.type(), QJsonRpcMessage::Notification); }
void TestQJsonRpcMessage::testResponseSameId() { QJsonRpcMessage request = QJsonRpcMessage::createRequest("testMethod"); QJsonRpcMessage response = request.createResponse("testResponse"); QCOMPARE(response.id(), request.id()); }