Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 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: |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 10 | ReportMock(std::string name) |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 11 | { |
| 12 | using namespace testing; |
| 13 | |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 14 | ON_CALL(*this, getName).WillByDefault([name] { return name; }); |
| 15 | ON_CALL(*this, getPath).WillByDefault([name] { return "/" + name; }); |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 16 | EXPECT_CALL(*this, Die).Times(AnyNumber()); |
| 17 | } |
| 18 | |
| 19 | virtual ~ReportMock() |
| 20 | { |
| 21 | Die(); |
| 22 | } |
| 23 | |
| 24 | MOCK_METHOD(std::string, getName, (), (override, const)); |
| 25 | MOCK_METHOD(std::string, getPath, (), (override, const)); |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame] | 26 | MOCK_METHOD(void, updateReadings, (), (override)); |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 27 | MOCK_METHOD(void, Die, ()); |
| 28 | }; |