blob: bc8491742406b92dc3c0c7e96ca10f43f87640ca [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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MOCK_STORE_H_
6#define SHILL_MOCK_STORE_H_
Darin Petkovba40dd32011-07-11 20:06:39 -07007
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <set>
9#include <string>
10#include <vector>
11
Ben Chancc67c522014-09-03 07:19:18 -070012#include <base/macros.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();
Ben Chan5ea763b2014-08-13 11:07:54 -070023 ~MockStore() override;
Darin Petkoveac68e62011-08-26 16:24:51 -070024
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,
Paul Stewart1e006c62015-06-16 12:29:06 -070028 std::set<std::string>(const std::string& key));
Paul Stewart5b9ec982013-01-18 14:12:14 -080029 MOCK_CONST_METHOD1(GetGroupsWithProperties,
Paul Stewart1e006c62015-06-16 12:29:06 -070030 std::set<std::string>(const KeyValueStore& properties));
31 MOCK_CONST_METHOD1(ContainsGroup, bool(const std::string& group));
32 MOCK_METHOD2(DeleteKey, bool(const std::string& group,
33 const std::string& key));
34 MOCK_METHOD1(DeleteGroup, bool(const std::string& group));
35 MOCK_METHOD1(SetHeader, bool(const std::string& header));
36 MOCK_CONST_METHOD3(GetString, bool(const std::string& group,
37 const std::string& key,
38 std::string* value));
39 MOCK_METHOD3(SetString, bool(const std::string& group,
40 const std::string& key,
41 const std::string& value));
42 MOCK_CONST_METHOD3(GetBool, bool(const std::string& group,
43 const std::string& key,
44 bool* value));
45 MOCK_METHOD3(SetBool, bool(const std::string& group,
46 const std::string& key,
Darin Petkovba40dd32011-07-11 20:06:39 -070047 bool value));
Paul Stewart1e006c62015-06-16 12:29:06 -070048 MOCK_CONST_METHOD3(GetInt, bool(const std::string& group,
49 const std::string& key,
50 int* value));
51 MOCK_METHOD3(SetInt, bool(const std::string& group,
52 const std::string& key,
Darin Petkovba40dd32011-07-11 20:06:39 -070053 int value));
Paul Stewart1e006c62015-06-16 12:29:06 -070054 MOCK_CONST_METHOD3(GetUint64, bool(const std::string& group,
55 const std::string& key,
56 uint64_t* value));
57 MOCK_METHOD3(SetUint64, bool(const std::string& group,
58 const std::string& key,
Ben Chan7fab8972014-08-10 17:14:46 -070059 uint64_t value));
Paul Stewart1e006c62015-06-16 12:29:06 -070060 MOCK_CONST_METHOD3(GetStringList, bool(const std::string& group,
61 const std::string& key,
62 std::vector<std::string>* value));
63 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
Ben Chanc45688b2014-07-02 23:50:45 -070079#endif // SHILL_MOCK_STORE_H_