Go to the documentation of this file.
12 #include <type_traits>
20 std::unique_ptr<MockServer>
held;
23 :
held(std::move(server))
27 throw std::runtime_error(
"A valid mock server instance required!");
40 virtual void stop()
override {
45 return held->isRunning();
virtual void stop() override
Allow to stop the server.
Definition: mock_holder.h:40
Definition: mock_server.h:22
virtual void start() override
Allow to start the server.
Definition: mock_holder.h:36
std::unique_ptr< MockServer > held
Instance of a mocking server.
Definition: mock_holder.h:20
Definition: mock_server.cc:20
virtual bool isRunning() const override
Return true if server is running.
Definition: mock_holder.h:44
MockServerHolder(std::unique_ptr< MockServer > &&server)
Definition: mock_holder.h:22
~MockServerHolder()=default
Definition: mock_holder.h:18
const std::unique_ptr< MockServer > & operator->() const
Definition: mock_holder.h:52
MockServerHolder & operator=(const MockServerHolder &)=default