Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MockRegistry.h
1 /*
2  * Copyright (C) 2013 Canonical Ltd
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_TESTING_MOCK_REGISTRY_H
20 #define UNITY_SCOPES_TESTING_MOCK_REGISTRY_H
21 
22 #include <unity/scopes/Registry.h>
23 #include <unity/scopes/testing/MockObject.h>
24 
25 #include <gmock/gmock.h>
26 
27 namespace unity
28 {
29 
30 namespace scopes
31 {
32 
33 namespace testing
34 {
35 
37 
38 class MockRegistry : public Registry, public virtual MockObject
39 {
40 public:
41  MockRegistry() = default;
42 
43  MOCK_METHOD1(get_metadata, ScopeMetadata(std::string const&));
44  MOCK_METHOD0(list, MetadataMap());
45  MOCK_METHOD1(list_if, MetadataMap(std::function<bool(ScopeMetadata const&)>));
46 };
47 
49 
50 } // namespace testing
51 
52 } // namespace scopes
53 
54 } // namespace unity
55 
56 #endif
std::map< std::string, ScopeMetadata > MetadataMap
Map for scope ID and metadata pairs.
Definition: Registry.h:42