Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "interfaces/trigger.hpp" |
| 4 | |
| 5 | #include <gmock/gmock.h> |
| 6 | |
| 7 | class TriggerMock : public interfaces::Trigger |
| 8 | { |
| 9 | public: |
Krzysztof Grobelny | fbeb5bf | 2022-01-03 09:41:29 +0100 | [diff] [blame] | 10 | explicit TriggerMock(std::string id) |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 11 | { |
| 12 | using namespace testing; |
| 13 | |
Szymon Dompke | e28aa53 | 2021-10-27 12:33:12 +0200 | [diff] [blame] | 14 | ON_CALL(*this, getId).WillByDefault([id] { return id; }); |
| 15 | ON_CALL(*this, getPath).WillByDefault([id] { return "/" + id; }); |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 16 | EXPECT_CALL(*this, Die).Times(AnyNumber()); |
| 17 | } |
| 18 | |
| 19 | virtual ~TriggerMock() |
| 20 | { |
| 21 | Die(); |
| 22 | } |
| 23 | |
Szymon Dompke | e28aa53 | 2021-10-27 12:33:12 +0200 | [diff] [blame] | 24 | MOCK_METHOD(std::string, getId, (), (const, override)); |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 25 | MOCK_METHOD(std::string, getPath, (), (const, override)); |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 26 | MOCK_METHOD(void, Die, ()); |
| 27 | }; |