blob: c34d5d42aa3ee84b2e7b3664fa18489011356874 [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
Paul Stewart5b9ec982013-01-18 14:12:14 -080015#include "shill/key_value_store.h"
Darin Petkovba40dd32011-07-11 20:06:39 -070016#include "shill/store_interface.h"
17
18namespace shill {
19
20class MockStore : public StoreInterface {
21 public:
Darin Petkoveac68e62011-08-26 16:24:51 -070022 MockStore();
23 virtual ~MockStore();
24
Chris Masoneb9c00592011-10-06 13:10:39 -070025 MOCK_METHOD0(Flush, bool());
Paul Stewart0756db92012-01-27 08:34:47 -080026 MOCK_CONST_METHOD0(GetGroups, std::set<std::string>());
27 MOCK_CONST_METHOD1(GetGroupsWithKey,
28 std::set<std::string>(const std::string &key));
Paul Stewart5b9ec982013-01-18 14:12:14 -080029 MOCK_CONST_METHOD1(GetGroupsWithProperties,
30 std::set<std::string>(const KeyValueStore &properties));
Paul Stewart0756db92012-01-27 08:34:47 -080031 MOCK_CONST_METHOD1(ContainsGroup, bool(const std::string &group));
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080032 MOCK_METHOD2(DeleteKey, bool(const std::string &group,
33 const std::string &key));
Darin Petkovba40dd32011-07-11 20:06:39 -070034 MOCK_METHOD1(DeleteGroup, bool(const std::string &group));
Paul Stewart5dc40aa2011-10-28 19:43:43 -070035 MOCK_METHOD1(SetHeader, bool(const std::string &header));
Paul Stewart0756db92012-01-27 08:34:47 -080036 MOCK_CONST_METHOD3(GetString, bool(const std::string &group,
37 const std::string &key,
38 std::string *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070039 MOCK_METHOD3(SetString, bool(const std::string &group,
40 const std::string &key,
41 const std::string &value));
Paul Stewart0756db92012-01-27 08:34:47 -080042 MOCK_CONST_METHOD3(GetBool, bool(const std::string &group,
43 const std::string &key,
44 bool *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070045 MOCK_METHOD3(SetBool, bool(const std::string &group,
46 const std::string &key,
47 bool value));
Paul Stewart0756db92012-01-27 08:34:47 -080048 MOCK_CONST_METHOD3(GetInt, bool(const std::string &group,
49 const std::string &key,
50 int *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070051 MOCK_METHOD3(SetInt, bool(const std::string &group,
52 const std::string &key,
53 int value));
Paul Stewartdab3b5a2012-07-11 18:25:10 -070054 MOCK_CONST_METHOD3(GetUint64, bool(const std::string &group,
55 const std::string &key,
56 uint64 *value));
57 MOCK_METHOD3(SetUint64, bool(const std::string &group,
58 const std::string &key,
59 uint64 value));
Paul Stewart0756db92012-01-27 08:34:47 -080060 MOCK_CONST_METHOD3(GetStringList, bool(const std::string &group,
61 const std::string &key,
62 std::vector<std::string> *value));
Darin Petkovba40dd32011-07-11 20:06:39 -070063 MOCK_METHOD3(SetStringList, bool(const std::string &group,
64 const std::string &key,
65 const std::vector<std::string> &value));
66 MOCK_METHOD3(GetCryptedString, bool(const std::string &group,
67 const std::string &key,
68 std::string *value));
69 MOCK_METHOD3(SetCryptedString, bool(const std::string &group,
70 const std::string &key,
71 const std::string &value));
Darin Petkoveac68e62011-08-26 16:24:51 -070072
73 private:
74 DISALLOW_COPY_AND_ASSIGN(MockStore);
Darin Petkovba40dd32011-07-11 20:06:39 -070075};
76
77} // namespace shill
78
79#endif // SHILL_MOCK_STORE_