blob: 2af965688602ee8561d8e6a47eb667b1c7dba57c [file] [log] [blame]
Chris Masonea82b7112011-05-25 15:16:29 -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#include "shill/mock_service.h"
6
7#include <string>
8
9#include <base/memory/ref_counted.h>
10#include <base/stringprintf.h>
11#include <gmock/gmock.h>
12
Chris Masone7aa5f902011-07-11 11:13:35 -070013#include "shill/refptr_types.h"
Chris Masone6515aab2011-10-12 16:19:09 -070014#include "shill/store_interface.h"
Gaurav Shah435de2c2011-11-17 19:01:07 -080015#include "shill/technology.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070016
17using std::string;
Paul Stewart22aa71b2011-09-16 12:15:11 -070018using testing::_;
Chris Masone6791a432011-07-12 13:23:19 -070019using testing::Return;
Chris Masone7aa5f902011-07-11 11:13:35 -070020
Chris Masonea82b7112011-05-25 15:16:29 -070021namespace shill {
22
23class ControlInterface;
24class EventDispatcher;
Chris Masone6791a432011-07-12 13:23:19 -070025class Manager;
Chris Masonea82b7112011-05-25 15:16:29 -070026
Chris Masonea82b7112011-05-25 15:16:29 -070027MockService::MockService(ControlInterface *control_interface,
28 EventDispatcher *dispatcher,
mukesh agrawal51a7e932011-07-27 16:18:26 -070029 Manager *manager)
Gaurav Shah435de2c2011-11-17 19:01:07 -080030 : Service(control_interface, dispatcher, manager, Technology::kUnknown) {
Chris Masone6515aab2011-10-12 16:19:09 -070031 const string &id = UniqueName();
32 EXPECT_CALL(*this, GetRpcIdentifier()).WillRepeatedly(Return(id));
33 EXPECT_CALL(*this, GetStorageIdentifier()).WillRepeatedly(Return(id));
Paul Stewart22aa71b2011-09-16 12:15:11 -070034 ON_CALL(*this, state()).WillByDefault(Return(kStateUnknown));
35 ON_CALL(*this, failure()).WillByDefault(Return(kFailureUnknown));
36 ON_CALL(*this, TechnologyIs(_)).WillByDefault(Return(false));
Chris Masonea82b7112011-05-25 15:16:29 -070037}
38
39MockService::~MockService() {}
40
Chris Masone6515aab2011-10-12 16:19:09 -070041bool MockService::FauxSave(StoreInterface *store) {
42 return store->SetString(UniqueName(), "dummy", "dummy");
43}
44
Chris Masonea82b7112011-05-25 15:16:29 -070045} // namespace shill