123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include "clienttest.h"
- #include <QCoreApplication>
- #include "testserviceclient.h"
- #include "http2channel.h"
- using namespace qtprotobufnamespace::tests;
- using namespace qtprotobuf::tests;
- using namespace qtprotobuf;
- ClientTest::ClientTest()
- {
- }
- TEST_F(ClientTest, CheckMethodsGeneration)
- {
-
- TestServiceClient testClient;
- SimpleStringMessage result;
- SimpleStringMessage request;
- testClient.testMethod(result, request);
- testClient.testMethod(result, std::function<void(const SimpleStringMessage&)>([](const SimpleStringMessage&){}));
- }
- TEST_F(ClientTest, StringEchoTest)
- {
- int argc = 0;
- QCoreApplication app(argc, nullptr);
- TestServiceClient testClient;
- testClient.attachChannel(std::make_shared<Http2Channel>("localhost", 50051));
- SimpleStringMessage result;
- SimpleStringMessage request;
- request.setTestFieldString("Hello beach!");
- testClient.testMethod(request, result);
- ASSERT_TRUE(result.testFieldString() == "Hello beach!");
- }
|