Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2021 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
| 18 | #include "sensors.hpp" |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 19 | |
| 20 | #include <string> |
| 21 | |
| 22 | #include <gmock/gmock.h> |
| 23 | |
| 24 | namespace phosphor::power::regulators |
| 25 | { |
| 26 | |
| 27 | /** |
| 28 | * @class MockSensors |
| 29 | * |
| 30 | * Mock implementation of the Sensors interface. |
| 31 | */ |
| 32 | class MockSensors : public Sensors |
| 33 | { |
| 34 | public: |
| 35 | // Specify which compiler-generated methods we want |
| 36 | MockSensors() = default; |
| 37 | MockSensors(const MockSensors&) = delete; |
| 38 | MockSensors(MockSensors&&) = delete; |
| 39 | MockSensors& operator=(const MockSensors&) = delete; |
| 40 | MockSensors& operator=(MockSensors&&) = delete; |
| 41 | virtual ~MockSensors() = default; |
| 42 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 43 | MOCK_METHOD(void, enable, (), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 44 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 45 | MOCK_METHOD(void, endCycle, (), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 46 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 47 | MOCK_METHOD(void, endRail, (bool errorOccurred), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 48 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 49 | MOCK_METHOD(void, disable, (), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 50 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 51 | MOCK_METHOD(void, setValue, (SensorType type, double value), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 52 | |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 53 | MOCK_METHOD(void, startCycle, (), (override)); |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 54 | |
| 55 | MOCK_METHOD(void, startRail, |
| 56 | (const std::string& rail, |
| 57 | const std::string& deviceInventoryPath, |
Shawn McCarney | c9c6951 | 2021-04-27 18:00:05 -0500 | [diff] [blame] | 58 | const std::string& chassisInventoryPath), |
Shawn McCarney | 0a45019 | 2021-04-12 16:13:24 -0500 | [diff] [blame] | 59 | (override)); |
| 60 | }; |
| 61 | |
| 62 | } // namespace phosphor::power::regulators |