From 6232d13f5321b87ddf12a1aa36b4545da45f173d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 17 Nov 2021 22:34:57 +0100 Subject: Travel3: Simple image and video display site Reads the images and videos from filesystem and builds a site in memroy. --- test/mock_transport.hh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/mock_transport.hh (limited to 'test/mock_transport.hh') diff --git a/test/mock_transport.hh b/test/mock_transport.hh new file mode 100644 index 0000000..7fe9235 --- /dev/null +++ b/test/mock_transport.hh @@ -0,0 +1,39 @@ +#ifndef MOCK_TRANSPORT_HH +#define MOCK_TRANSPORT_HH + +#include "transport.hh" + +#include + +class MockTransport : public Transport { +public: + std::unique_ptr create_data(uint16_t code, std::string data) + override { + return std::unique_ptr(create_data_proxy(code, std::move(data))); + } + + MOCK_METHOD(std::unique_ptr, create_file, + (uint16_t, std::filesystem::path), + (override)); + MOCK_METHOD(std::unique_ptr, create_exif_thumbnail, + (uint16_t, std::filesystem::path), + (override)); + MOCK_METHOD(void, add_client, (unique_fd&&), (override)); + + MOCK_METHOD(Response*, create_data_proxy, (uint16_t, std::string)); +}; + +class MockResponse : public Transport::Response { +public: + MOCK_METHOD(uint16_t, code, (), (override, const)); + MOCK_METHOD((std::vector> const&), + headers, (), (override, const)); + MOCK_METHOD(std::unique_ptr, open_content, (), (override)); + MOCK_METHOD(void, open_content_async, ( + std::shared_ptr, + std::function)>), + (override)); + MOCK_METHOD(void, add_header, (std::string, std::string), (override)); +}; + +#endif // MOCK_TRANSPORT_HH -- cgit v1.2.3-70-g09d2