Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 1 | // 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 Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <set> |
| 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 12 | #include <base/basictypes.h> |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 13 | #include <gmock/gmock.h> |
| 14 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 15 | #include "shill/key_value_store.h" |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 16 | #include "shill/store_interface.h" |
| 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | class MockStore : public StoreInterface { |
| 21 | public: |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 22 | MockStore(); |
| 23 | virtual ~MockStore(); |
| 24 | |
Chris Masone | b9c0059 | 2011-10-06 13:10:39 -0700 | [diff] [blame] | 25 | MOCK_METHOD0(Flush, bool()); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 26 | MOCK_CONST_METHOD0(GetGroups, std::set<std::string>()); |
| 27 | MOCK_CONST_METHOD1(GetGroupsWithKey, |
| 28 | std::set<std::string>(const std::string &key)); |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 29 | MOCK_CONST_METHOD1(GetGroupsWithProperties, |
| 30 | std::set<std::string>(const KeyValueStore &properties)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 31 | MOCK_CONST_METHOD1(ContainsGroup, bool(const std::string &group)); |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 32 | MOCK_METHOD2(DeleteKey, bool(const std::string &group, |
| 33 | const std::string &key)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 34 | MOCK_METHOD1(DeleteGroup, bool(const std::string &group)); |
Paul Stewart | 5dc40aa | 2011-10-28 19:43:43 -0700 | [diff] [blame] | 35 | MOCK_METHOD1(SetHeader, bool(const std::string &header)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 36 | MOCK_CONST_METHOD3(GetString, bool(const std::string &group, |
| 37 | const std::string &key, |
| 38 | std::string *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 39 | MOCK_METHOD3(SetString, bool(const std::string &group, |
| 40 | const std::string &key, |
| 41 | const std::string &value)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 42 | MOCK_CONST_METHOD3(GetBool, bool(const std::string &group, |
| 43 | const std::string &key, |
| 44 | bool *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 45 | MOCK_METHOD3(SetBool, bool(const std::string &group, |
| 46 | const std::string &key, |
| 47 | bool value)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 48 | MOCK_CONST_METHOD3(GetInt, bool(const std::string &group, |
| 49 | const std::string &key, |
| 50 | int *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 51 | MOCK_METHOD3(SetInt, bool(const std::string &group, |
| 52 | const std::string &key, |
| 53 | int value)); |
Paul Stewart | dab3b5a | 2012-07-11 18:25:10 -0700 | [diff] [blame] | 54 | 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 Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 60 | MOCK_CONST_METHOD3(GetStringList, bool(const std::string &group, |
| 61 | const std::string &key, |
| 62 | std::vector<std::string> *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 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 Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 72 | |
| 73 | private: |
| 74 | DISALLOW_COPY_AND_ASSIGN(MockStore); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | } // namespace shill |
| 78 | |
| 79 | #endif // SHILL_MOCK_STORE_ |