mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
68148e098f
* add unit tests with ability to pretend to be different network setups
26 lines
548 B
C++
26 lines
548 B
C++
#pragma once
|
|
#include <llarp/router/router.hpp>
|
|
|
|
#include "mock_network.hpp"
|
|
|
|
namespace mocks
|
|
{
|
|
class MockRouter : public llarp::Router
|
|
{
|
|
const Network& _net;
|
|
|
|
public:
|
|
explicit MockRouter(const Network& net, std::shared_ptr<llarp::vpn::Platform> vpnPlatform)
|
|
: llarp::
|
|
Router{std::shared_ptr<llarp::EventLoop>{const_cast<Network*>(&net), [](Network*) {}}, vpnPlatform}
|
|
, _net{net}
|
|
{}
|
|
|
|
const llarp::net::Platform&
|
|
Net() const override
|
|
{
|
|
return _net;
|
|
};
|
|
};
|
|
} // namespace mocks
|