1#ifndef TENDUKE_TEST_MOCKS_SOCKETMOCK_H
2#define TENDUKE_TEST_MOCKS_SOCKETMOCK_H
6#include "gmock/gmock.h"
8namespace tenduke {
namespace test {
namespace mocks {
13 MOCK_METHOD((std::unique_ptr<tenduke::osa::Socket>),
accept, (std::uint32_t timeoutMs), (
override));
14 MOCK_METHOD((std::unique_ptr<tenduke::osa::Socket>),
accept, (), (
override));
15 MOCK_METHOD(
void,
listen, (), (
override));
16 MOCK_METHOD(
int,
read, (
void * buffer, std::size_t bufferSize), (
override));
17 MOCK_METHOD(
int,
write, (
const void * buffer, std::size_t bufferSize), (
override));
18 MOCK_METHOD(std::uint16_t,
getPort, (), (
const,
override));
21 static std::shared_ptr<SocketMock> createShared()
23 return std::make_shared<SocketMock>();
OS-independent abstraction of a socket.
Definition Socket.h:14
virtual int write(const void *buffer, std::size_t len)=0
Write bytes to the socket.
virtual int read(void *buffer, std::size_t bufferSize)=0
Reads bytes from the socket.
virtual void setNonBlocking()=0
Sets the socket to non-blocking mode.
virtual std::unique_ptr< Socket > accept()=0
Accepts next connection from listening socket.
virtual std::uint16_t getPort() const =0
Returns port of the socket.
virtual void listen()=0
Configures the socket to listen for incoming connections.
Definition SocketMock.h:11
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4