Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "interfaces/report_factory.hpp" |
| 4 | #include "mocks/report_mock.hpp" |
| 5 | |
| 6 | #include <gmock/gmock.h> |
| 7 | |
| 8 | class ReportFactoryMock : public interfaces::ReportFactory |
| 9 | { |
| 10 | public: |
| 11 | ReportFactoryMock() |
| 12 | { |
| 13 | using namespace testing; |
| 14 | |
| 15 | ON_CALL(*this, make) |
| 16 | .WillByDefault(WithArgs<0>(Invoke([](const std::string& name) { |
| 17 | return std::make_unique<NiceMock<ReportMock>>(name); |
| 18 | }))); |
| 19 | } |
| 20 | |
| 21 | MOCK_METHOD(std::unique_ptr<interfaces::Report>, make, |
| 22 | (const std::string& name, const std::string& reportingType, |
| 23 | bool emitsReadingsSignal, bool logToMetricReportsCollection, |
| 24 | std::chrono::milliseconds period, |
| 25 | const ReadingParameters& metricParams, |
| 26 | interfaces::ReportManager& reportManager), |
| 27 | (const, override)); |
| 28 | }; |