Unity Scopes API
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 #pragma once
20 
21 #include <unity/scopes/Scope.h>
22 
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 MockScope : public unity::scopes::Scope, public unity::scopes::testing::MockObject
39 {
40 public:
41  MockScope() = default;
42 
43  MOCK_METHOD3(search, QueryCtrlProxy(std::string const&,
44  SearchMetadata const&,
45  SearchListenerBase::SPtr const&));
46  MOCK_METHOD4(search, QueryCtrlProxy(std::string const&,
47  FilterState const&,
48  SearchMetadata const&,
49  SearchListenerBase::SPtr const&));
50  MOCK_METHOD5(search, QueryCtrlProxy(std::string const&,
51  std::string const&,
52  FilterState const&,
53  SearchMetadata const&,
54  SearchListenerBase::SPtr const&));
55  MOCK_METHOD3(activate, QueryCtrlProxy(unity::scopes::Result const&,
56  ActionMetadata const&,
57  ActivationListenerBase::SPtr const&));
58  MOCK_METHOD5(perform_action, QueryCtrlProxy(unity::scopes::Result const&,
59  ActionMetadata const&,
60  std::string const&,
61  std::string const&,
62  ActivationListenerBase::SPtr const&));
63  MOCK_METHOD3(preview, QueryCtrlProxy(unity::scopes::Result const&,
64  ActionMetadata const&,
65  PreviewListenerBase::SPtr const&));
66 
67  MOCK_METHOD0(child_scopes_ordered, ChildScopeList());
68 
69  MOCK_METHOD1(set_child_scopes_ordered, bool(ChildScopeList const&));
70 };
71 
73 
74 } // namespace testing
75 
76 } // namespace scopes
77 
78 } // namespace unity
The attributes of a result returned by a Scope.
Definition: Result.h:50
Definition: OnlineAccountClient.h:39
Top-level namespace for all things Unity-related.
Definition: Version.h:49
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:33
std::list< ChildScope > ChildScopeList
A list of child scopes.
Definition: ChildScope.h:30