blob: 40ba16c9f267ddf45bb030dd58fb294057363dbc [file] [log] [blame]
Chris Masone9be4a9d2011-05-16 15:44:09 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_MOCK_DEVICE_
6#define SHILL_MOCK_DEVICE_
7
Chris Masone46eaaf52011-05-24 13:08:30 -07008#include <string>
9
Chris Masone9be4a9d2011-05-16 15:44:09 -070010#include <base/memory/ref_counted.h>
11#include <gmock/gmock.h>
12
13#include "shill/device.h"
14
15namespace shill {
16
17class ControlInterface;
18class EventDispatcher;
19
20using ::testing::_;
21using ::testing::Return;
22
23class MockDevice : public Device {
24 public:
25 // A constructor for the Device object
26 MockDevice(ControlInterface *control_interface,
Paul Stewartb50f0b92011-05-16 16:31:42 -070027 EventDispatcher *dispatcher,
Paul Stewartf1ce5d22011-05-19 13:10:20 -070028 const std::string& link_name,
Paul Stewartb50f0b92011-05-16 16:31:42 -070029 int interface_index)
Paul Stewartf1ce5d22011-05-19 13:10:20 -070030 : Device(control_interface, dispatcher, NULL, link_name,
31 interface_index) {
Chris Masone9be4a9d2011-05-16 15:44:09 -070032 ON_CALL(*this, TechnologyIs(_)).WillByDefault(Return(false));
33 }
34 virtual ~MockDevice() {}
35
36 MOCK_METHOD0(Start, void(void));
37 MOCK_METHOD0(Stop, void(void));
38 MOCK_METHOD1(TechnologyIs, bool(Technology));
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(MockDevice);
42};
43
44} // namespace shill
45
46#endif // SHILL_MOCK_DEVICE_