1 #pragma once 2 3 #include "interfaces/report.hpp" 4 5 #include <gmock/gmock.h> 6 7 class ReportMock : public interfaces::Report 8 { 9 public: 10 ReportMock(std::string reportName) 11 { 12 using namespace testing; 13 14 ON_CALL(*this, getName).WillByDefault([reportName] { 15 return reportName; 16 }); 17 ON_CALL(*this, getPath).WillByDefault([reportName] { 18 return "/" + reportName; 19 }); 20 21 EXPECT_CALL(*this, Die).Times(AnyNumber()); 22 } 23 24 virtual ~ReportMock() 25 { 26 Die(); 27 } 28 29 MOCK_METHOD(std::string, getName, (), (override, const)); 30 MOCK_METHOD(std::string, getPath, (), (override, const)); 31 MOCK_METHOD(void, Die, ()); 32 }; 33