1//
2// Copyright (C) 2012 The Android Open Source Project
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
17#ifndef SHILL_CELLULAR_MOCK_MODEM_H_
18#define SHILL_CELLULAR_MOCK_MODEM_H_
19
20#include <string>
21
22#include <gmock/gmock.h>
23
24#include "shill/cellular/modem.h"
25
26namespace shill {
27
28class MockModem : public Modem {
29 public:
30  MockModem(const std::string& service,
31            const std::string& path,
32            ModemInfo* modem_info,
33            ControlInterface* control_interface);
34  ~MockModem() override;
35
36  // This class only mocks the pure virtual methods; if you need a
37  // more thorough mock, know that modem_unittest.cc depends on the
38  // incompleteness of this mock.
39  MOCK_METHOD1(SetModemStateFromProperties,
40               void(const KeyValueStore& properties));
41  MOCK_CONST_METHOD2(GetLinkName,
42                     bool(const KeyValueStore& modem_properties,
43                          std::string* name));
44  MOCK_CONST_METHOD0(GetModemInterface,
45                     std::string(void));
46  MOCK_METHOD3(ConstructCellular, Cellular*(
47      const std::string& link_name,
48      const std::string& device_name,
49      int ifindex));
50};
51typedef ::testing::StrictMock<MockModem> StrictModem;
52
53}  // namespace shill
54
55#endif  // SHILL_CELLULAR_MOCK_MODEM_H_
56