blob: fcb9b7eaea0980acd3ccd89cea2a12acaa31b1c7 [file] [log] [blame]
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +02001#pragma once
2
3#include "interfaces/report_factory.hpp"
4#include "mocks/report_mock.hpp"
5
6#include <gmock/gmock.h>
7
8class ReportFactoryMock : public interfaces::ReportFactory
9{
10 public:
11 ReportFactoryMock()
12 {
13 using namespace testing;
14
15 ON_CALL(*this, make)
Wludzik, Jozefe2362792020-10-27 17:23:55 +010016 .WillByDefault(WithArgs<1>(Invoke([](const std::string& name) {
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020017 return std::make_unique<NiceMock<ReportMock>>(name);
18 })));
19 }
20
Wludzik, Jozefe2362792020-10-27 17:23:55 +010021 MOCK_METHOD(
22 std::unique_ptr<interfaces::Report>, make,
23 (std::optional<std::reference_wrapper<boost::asio::yield_context>>,
24 const std::string& name, const std::string& reportingType,
25 bool emitsReadingsSignal, bool logToMetricReportsCollection,
26 std::chrono::milliseconds period,
27 const ReadingParameters& metricParams,
28 interfaces::ReportManager& reportManager,
29 interfaces::JsonStorage& reportStorage),
30 (const, override));
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020031};