blob: b649e9ce83d5abe5635f2410795ca58a3064cb25 [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"
Shawn McCarney0a450192021-04-12 16:13:24 -050019
20#include <string>
21
22#include <gmock/gmock.h>
23
24namespace phosphor::power::regulators
25{
26
27/**
28 * @class MockSensors
29 *
30 * Mock implementation of the Sensors interface.
31 */
32class 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 McCarneyc9c69512021-04-27 18:00:05 -050043 MOCK_METHOD(void, enable, (), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050044
Shawn McCarneyc9c69512021-04-27 18:00:05 -050045 MOCK_METHOD(void, endCycle, (), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050046
Shawn McCarneyc9c69512021-04-27 18:00:05 -050047 MOCK_METHOD(void, endRail, (bool errorOccurred), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050048
Shawn McCarneyc9c69512021-04-27 18:00:05 -050049 MOCK_METHOD(void, disable, (), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050050
Shawn McCarneyc9c69512021-04-27 18:00:05 -050051 MOCK_METHOD(void, setValue, (SensorType type, double value), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050052
Shawn McCarneyc9c69512021-04-27 18:00:05 -050053 MOCK_METHOD(void, startCycle, (), (override));
Shawn McCarney0a450192021-04-12 16:13:24 -050054
55 MOCK_METHOD(void, startRail,
56 (const std::string& rail,
57 const std::string& deviceInventoryPath,
Shawn McCarneyc9c69512021-04-27 18:00:05 -050058 const std::string& chassisInventoryPath),
Shawn McCarney0a450192021-04-12 16:13:24 -050059 (override));
60};
61
62} // namespace phosphor::power::regulators