blob: 73aece75cbe7706ff44a777dc65f8281bd8490cc [file] [log] [blame]
Darin Petkovba40dd32011-07-11 20:06:39 -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_STORE_
6#define SHILL_MOCK_STORE_
7
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <set>
9#include <string>
10#include <vector>
11
Darin Petkoveac68e62011-08-26 16:24:51 -070012#include <base/basictypes.h>
Darin Petkovba40dd32011-07-11 20:06:39 -070013#include <gmock/gmock.h>
14
15#include "shill/store_interface.h"
16
17namespace shill {
18
19class MockStore : public StoreInterface {
20 public:
Darin Petkoveac68e62011-08-26 16:24:51 -070021 MockStore();
22 virtual ~MockStore();
23
Chris Masoneb9c00592011-10-06 13:10:39 -070024 MOCK_METHOD0(Flush, bool());
Paul Stewart0756db92012-01-27 08:34:47 -080025 MOCK_CONST_METHOD0(GetGroups, std::set<std::string>());
26 MOCK_CONST_METHOD1(GetGroupsWithKey,
27 std::set<std::string>(const std::string &key));
28 MOCK_CONST_METHOD1(ContainsGroup, bool(const std::string &group));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080029 MOCK_METHOD2(DeleteKey, bool(const std::string &group,
30 const std::string &key));
Darin Petkovba40dd32011-07-11 20:06:39 -070031 MOCK_METHOD1(DeleteGroup, bool(const std::string &group));
Paul Stewart5dc40aa2011-10-28 19:43:43 -070032 MOCK_METHOD1(SetHeader, bool(const std::string &header));
Paul Stewart0756db92012-01-27 08:34:47 -080033 MOCK_CONST_METHOD3(GetString, bool(const std::string &group,
34 const std::string &key,
35 std::string *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070036 MOCK_METHOD3(SetString, bool(const std::string &group,
37 const std::string &key,
38 const std::string &value));
Paul Stewart0756db92012-01-27 08:34:47 -080039 MOCK_CONST_METHOD3(GetBool, bool(const std::string &group,
40 const std::string &key,
41 bool *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070042 MOCK_METHOD3(SetBool, bool(const std::string &group,
43 const std::string &key,
44 bool value));
Paul Stewart0756db92012-01-27 08:34:47 -080045 MOCK_CONST_METHOD3(GetInt, bool(const std::string &group,
46 const std::string &key,
47 int *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070048 MOCK_METHOD3(SetInt, bool(const std::string &group,
49 const std::string &key,
50 int value));
Paul Stewartdab3b5a2012-07-11 18:25:10 -070051 MOCK_CONST_METHOD3(GetUint64, bool(const std::string &group,
52 const std::string &key,
53 uint64 *value));
54 MOCK_METHOD3(SetUint64, bool(const std::string &group,
55 const std::string &key,
56 uint64 value));
Paul Stewart0756db92012-01-27 08:34:47 -080057 MOCK_CONST_METHOD3(GetStringList, bool(const std::string &group,
58 const std::string &key,
59 std::vector<std::string> *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070060 MOCK_METHOD3(SetStringList, bool(const std::string &group,
61 const std::string &key,
62 const std::vector<std::string> &value));
63 MOCK_METHOD3(GetCryptedString, bool(const std::string &group,
64 const std::string &key,
65 std::string *value));
66 MOCK_METHOD3(SetCryptedString, bool(const std::string &group,
67 const std::string &key,
68 const std::string &value));
Darin Petkoveac68e62011-08-26 16:24:51 -070069
70 private:
71 DISALLOW_COPY_AND_ASSIGN(MockStore);
Darin Petkovba40dd32011-07-11 20:06:39 -070072};
73
74} // namespace shill
75
76#endif // SHILL_MOCK_STORE_