Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MockScope.h
1 /*
2  * Copyright (C) 2014 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: James Henstridge <james.henstridge@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_TESTING_MOCK_SCOPE_H
20 #define UNITY_SCOPES_TESTING_MOCK_SCOPE_H
21 
22 #include <unity/scopes/Scope.h>
23 
24 #include <unity/scopes/testing/MockObject.h>
25 
26 #include <gmock/gmock.h>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace testing
35 {
36 
38 
39 class MockScope : public unity::scopes::Scope, public unity::scopes::testing::MockObject
40 {
41 public:
42  MockScope() = default;
43 
44  MOCK_METHOD3(search, QueryCtrlProxy(std::string const&,
45  SearchMetadata const&,
46  SearchListenerBase::SPtr const&));
47  MOCK_METHOD4(search, QueryCtrlProxy(std::string const&,
48  FilterState const&,
49  SearchMetadata const&,
50  SearchListenerBase::SPtr const&));
51  MOCK_METHOD5(search, QueryCtrlProxy(std::string const&,
52  std::string const&,
53  FilterState const&,
54  SearchMetadata const&,
55  SearchListenerBase::SPtr const&));
56  MOCK_METHOD3(activate, QueryCtrlProxy(unity::scopes::Result const&,
57  ActionMetadata const&,
58  ActivationListenerBase::SPtr const&));
59  MOCK_METHOD5(perform_action, QueryCtrlProxy(unity::scopes::Result const&,
60  ActionMetadata const&,
61  std::string const&,
62  std::string const&,
63  ActivationListenerBase::SPtr const&));
64  MOCK_METHOD3(preview, QueryCtrlProxy(unity::scopes::Result const&,
65  ActionMetadata const&,
66  PreviewListenerBase::SPtr const&));
67 };
68 
70 
71 } // namespace testing
72 
73 } // namespace scopes
74 
75 } // namespace unity
76 
77 #endif
The attributes of a result returned by a Scope.
Definition: Result.h:51
Definition: OnlineAccountClient.h:40
Top-level namespace for all things Unity-related.
Definition: Version.h:50
Allows queries, preview requests, and activation requests to be sent to a scope.
Definition: Scope.h:45
std::shared_ptr< QueryCtrl > QueryCtrlProxy
Convenience type definition.
Definition: QueryCtrlProxyFwd.h:34