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"
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 
43     MOCK_METHOD(void, enable, (), (override));
44 
45     MOCK_METHOD(void, endCycle, (), (override));
46 
47     MOCK_METHOD(void, endRail, (bool errorOccurred), (override));
48 
49     MOCK_METHOD(void, disable, (), (override));
50 
51     MOCK_METHOD(void, setValue, (SensorType type, double value), (override));
52 
53     MOCK_METHOD(void, startCycle, (), (override));
54 
55     MOCK_METHOD(void, startRail,
56                 (const std::string& rail,
57                  const std::string& deviceInventoryPath,
58                  const std::string& chassisInventoryPath),
59                 (override));
60 };
61 
62 } // namespace phosphor::power::regulators
63