Lei YU | ebd3d09 | 2020-09-27 18:11:48 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "utils.hpp" |
| 4 | |
| 5 | #include <gmock/gmock.h> |
| 6 | |
| 7 | namespace utils |
| 8 | { |
| 9 | |
| 10 | class MockedUtils : public UtilsInterface |
| 11 | { |
| 12 | public: |
| 13 | virtual ~MockedUtils() = default; |
| 14 | |
| 15 | MOCK_CONST_METHOD3(getService, |
| 16 | std::string(sdbusplus::bus::bus& bus, const char* path, |
| 17 | const char* interface)); |
| 18 | |
| 19 | MOCK_CONST_METHOD3(getServices, |
| 20 | std::vector<std::string>(sdbusplus::bus::bus& bus, |
| 21 | const char* path, |
| 22 | const char* interface)); |
| 23 | |
| 24 | MOCK_CONST_METHOD5(getPropertyImpl, |
| 25 | any(sdbusplus::bus::bus& bus, const char* service, |
| 26 | const char* path, const char* interface, |
| 27 | const char* propertyName)); |
| 28 | |
| 29 | MOCK_CONST_METHOD6(setPropertyImpl, |
| 30 | void(sdbusplus::bus::bus& bus, const char* service, |
| 31 | const char* path, const char* interface, |
| 32 | const char* propertyName, ValueType&& value)); |
| 33 | }; |
| 34 | |
| 35 | const UtilsInterface& getUtils(); |
| 36 | |
| 37 | void freeUtils(); |
| 38 | |
| 39 | } // namespace utils |