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<1>(Invoke([](const std::string& name) { 17 return std::make_unique<NiceMock<ReportMock>>(name); 18 }))); 19 } 20 21 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)); 31 }; 32