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 | |
| 15 | #include "shill/store_interface.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | |
| 19 | class MockStore : public StoreInterface { |
| 20 | public: |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 21 | MockStore(); |
| 22 | virtual ~MockStore(); |
| 23 | |
Chris Masone | b9c0059 | 2011-10-06 13:10:39 -0700 | [diff] [blame] | 24 | MOCK_METHOD0(Flush, bool()); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 25 | 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 Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 29 | MOCK_METHOD2(DeleteKey, bool(const std::string &group, |
| 30 | const std::string &key)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 31 | MOCK_METHOD1(DeleteGroup, bool(const std::string &group)); |
Paul Stewart | 5dc40aa | 2011-10-28 19:43:43 -0700 | [diff] [blame] | 32 | MOCK_METHOD1(SetHeader, bool(const std::string &header)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 33 | MOCK_CONST_METHOD3(GetString, bool(const std::string &group, |
| 34 | const std::string &key, |
| 35 | std::string *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 36 | MOCK_METHOD3(SetString, bool(const std::string &group, |
| 37 | const std::string &key, |
| 38 | const std::string &value)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 39 | MOCK_CONST_METHOD3(GetBool, bool(const std::string &group, |
| 40 | const std::string &key, |
| 41 | bool *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 42 | MOCK_METHOD3(SetBool, bool(const std::string &group, |
| 43 | const std::string &key, |
| 44 | bool value)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 45 | MOCK_CONST_METHOD3(GetInt, bool(const std::string &group, |
| 46 | const std::string &key, |
| 47 | int *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 48 | MOCK_METHOD3(SetInt, bool(const std::string &group, |
| 49 | const std::string &key, |
| 50 | int value)); |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 51 | MOCK_CONST_METHOD3(GetStringList, bool(const std::string &group, |
| 52 | const std::string &key, |
| 53 | std::vector<std::string> *value)); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 54 | MOCK_METHOD3(SetStringList, bool(const std::string &group, |
| 55 | const std::string &key, |
| 56 | const std::vector<std::string> &value)); |
| 57 | MOCK_METHOD3(GetCryptedString, bool(const std::string &group, |
| 58 | const std::string &key, |
| 59 | std::string *value)); |
| 60 | MOCK_METHOD3(SetCryptedString, bool(const std::string &group, |
| 61 | const std::string &key, |
| 62 | const std::string &value)); |
Darin Petkov | eac68e6 | 2011-08-26 16:24:51 -0700 | [diff] [blame] | 63 | |
| 64 | private: |
| 65 | DISALLOW_COPY_AND_ASSIGN(MockStore); |
Darin Petkov | ba40dd3 | 2011-07-11 20:06:39 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | } // namespace shill |
| 69 | |
| 70 | #endif // SHILL_MOCK_STORE_ |