lokinet/test/mocks/mock_router.hpp
Jeff 68148e098f
* add mockable network functions
* add unit tests with ability to pretend to be different network setups
2022-07-20 13:36:03 -04:00

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