blob: 0973d7cb9270a47a513116d9c641102f5e1236f6 [file] [log] [blame]
Shawn McCarney0a450192021-04-12 16:13:24 -05001/**
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#include "services.hpp"
20
21#include <string>
22
23#include <gmock/gmock.h>
24
25namespace phosphor::power::regulators
26{
27
28/**
29 * @class MockSensors
30 *
31 * Mock implementation of the Sensors interface.
32 */
33class MockSensors : public Sensors
34{
35 public:
36 // Specify which compiler-generated methods we want
37 MockSensors() = default;
38 MockSensors(const MockSensors&) = delete;
39 MockSensors(MockSensors&&) = delete;
40 MockSensors& operator=(const MockSensors&) = delete;
41 MockSensors& operator=(MockSensors&&) = delete;
42 virtual ~MockSensors() = default;
43
44 MOCK_METHOD(void, enable, (Services & services), (override));
45
46 MOCK_METHOD(void, endCycle, (Services & services), (override));
47
48 MOCK_METHOD(void, endRail, (bool errorOccurred, Services& services),
49 (override));
50
51 MOCK_METHOD(void, disable, (Services & services), (override));
52
53 MOCK_METHOD(void, setValue,
54 (SensorType type, double value, Services& services),
55 (override));
56
57 MOCK_METHOD(void, startCycle, (Services & services), (override));
58
59 MOCK_METHOD(void, startRail,
60 (const std::string& rail,
61 const std::string& deviceInventoryPath,
62 const std::string& chassisInventoryPath, Services& services),
63 (override));
64};
65
66} // namespace phosphor::power::regulators