blob: 7de6948f80e0a61bd9f5e78693bf36f275ccfe74 [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_SERVICE_
6#define SHILL_MOCK_SERVICE_
7
8#include <base/memory/ref_counted.h>
9#include <gmock/gmock.h>
10
Chris Masone7aa5f902011-07-11 11:13:35 -070011#include "shill/refptr_types.h"
Chris Masone9be4a9d2011-05-16 15:44:09 -070012#include "shill/service.h"
13
14namespace shill {
15
Chris Masone9be4a9d2011-05-16 15:44:09 -070016class MockService : public Service {
17 public:
18 // A constructor for the Service object
19 MockService(ControlInterface *control_interface,
20 EventDispatcher *dispatcher,
mukesh agrawal51a7e932011-07-27 16:18:26 -070021 Manager *manager);
Chris Masonea82b7112011-05-25 15:16:29 -070022 virtual ~MockService();
Chris Masone9be4a9d2011-05-16 15:44:09 -070023
Darin Petkov4d6d9412011-08-24 13:19:54 -070024 MOCK_METHOD1(Connect, void(Error *error));
Chris Masone6791a432011-07-12 13:23:19 -070025 MOCK_METHOD0(Disconnect, void());
26 MOCK_METHOD0(CalculateState, std::string());
Paul Stewart22aa71b2011-09-16 12:15:11 -070027 MOCK_CONST_METHOD1(TechnologyIs,
28 bool(const Technology::Identifier technology));
Paul Stewart03dba0b2011-08-22 16:32:45 -070029 MOCK_METHOD1(SetState, void(ConnectState state));
30 MOCK_CONST_METHOD0(state, ConnectState());
31 MOCK_METHOD1(SetFailure, void(ConnectFailure failure));
32 MOCK_CONST_METHOD0(failure, ConnectFailure());
Chris Masone6791a432011-07-12 13:23:19 -070033 MOCK_METHOD0(GetDeviceRpcId, std::string());
34 MOCK_CONST_METHOD0(GetRpcIdentifier, std::string());
Chris Masone6515aab2011-10-12 16:19:09 -070035 MOCK_CONST_METHOD0(GetStorageIdentifier, std::string());
Paul Stewart22aa71b2011-09-16 12:15:11 -070036 MOCK_METHOD1(Load, bool(StoreInterface *store_interface));
37 MOCK_METHOD1(Save, bool(StoreInterface *store_interface));
Chris Masone34af2182011-08-22 11:59:36 -070038
Chris Masone6515aab2011-10-12 16:19:09 -070039 // Set a string for this Service via |store|. Can be wired to Save() for
40 // test purposes.
41 bool FauxSave(StoreInterface *store);
42
Chris Masone9be4a9d2011-05-16 15:44:09 -070043 private:
44 DISALLOW_COPY_AND_ASSIGN(MockService);
45};
46
47} // namespace shill
48
49#endif // SHILL_MOCK_SERVICE_