aboutsummaryrefslogtreecommitdiff
path: root/test/nostr_service_test.cpp
diff options
context:
space:
mode:
authorLibravatar Michael Jurkoic <mjjurkoic@gmail.com>2024-03-17 19:15:29 -0500
committerLibravatar Michael Jurkoic <mjjurkoic@gmail.com>2024-03-17 19:15:29 -0500
commit9832867f9ed9dbcc7ffbd135291bc54c153640b0 (patch)
tree903b0f36b5a3faf379a18f27692be878054b8cef /test/nostr_service_test.cpp
parentc7096828e62fcea63120504b867150130377ab75 (diff)
Define a receive method on the WebSocket interface
Diffstat (limited to 'test/nostr_service_test.cpp')
-rw-r--r--test/nostr_service_test.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/nostr_service_test.cpp b/test/nostr_service_test.cpp
index 83de3be..d4fc71b 100644
--- a/test/nostr_service_test.cpp
+++ b/test/nostr_service_test.cpp
@@ -7,11 +7,13 @@
#include <client/web_socket_client.hpp>
#include <nostr.hpp>
+using std::function;
using std::lock_guard;
using std::make_shared;
using std::mutex;
using std::shared_ptr;
using std::string;
+using std::tuple;
using std::unordered_map;
using ::testing::_;
using ::testing::Invoke;
@@ -23,10 +25,11 @@ class MockWebSocketClient : public client::IWebSocketClient {
public:
MOCK_METHOD(void, start, (), (override));
MOCK_METHOD(void, stop, (), (override));
- MOCK_METHOD(void, openConnection, (std::string uri), (override));
- MOCK_METHOD(bool, isConnected, (std::string uri), (override));
- MOCK_METHOD((std::tuple<std::string, bool>), send, (std::string message, std::string uri), (override));
- MOCK_METHOD(void, closeConnection, (std::string uri), (override));
+ MOCK_METHOD(void, openConnection, (string uri), (override));
+ MOCK_METHOD(bool, isConnected, (string uri), (override));
+ MOCK_METHOD((tuple<string, bool>), send, (string message, string uri), (override));
+ MOCK_METHOD(void, receive, (string uri, function<void(const string&)> messageHandler), (override));
+ MOCK_METHOD(void, closeConnection, (string uri), (override));
};
class NostrServiceTest : public testing::Test