Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MockSearchReply.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_SEARCHREPLY_H
20 #define UNITY_SCOPES_TESTING_MOCK_SEARCHREPLY_H
21 
22 #include <unity/scopes/CategorisedResult.h>
23 #include <unity/scopes/SearchReply.h>
24 #include <unity/scopes/Department.h>
25 
26 #include <unity/scopes/testing/MockObject.h>
27 
28 #include <gmock/gmock.h>
29 
30 namespace unity
31 {
32 
33 namespace scopes
34 {
35 
36 namespace testing
37 {
38 
40 
41 class MockSearchReply : public unity::scopes::SearchReply, public virtual MockObject
42 {
43 public:
44  MockSearchReply() = default;
45 
46  // From Reply
47  MOCK_METHOD0(finished, void());
48  MOCK_METHOD1(error, void(std::exception_ptr));
49  MOCK_METHOD1(info, void(OperationInfo const&));
50 
51  // From SearchReply
52  MOCK_METHOD1(register_departments, void(Department::SCPtr const&));
53  MOCK_METHOD4(register_category,
54  Category::SCPtr(std::string const&,
55  std::string const&,
56  std::string const&,
57  CategoryRenderer const&));
58  MOCK_METHOD5(register_category,
59  Category::SCPtr(std::string const&,
60  std::string const&,
61  std::string const&,
62  CannedQuery const&,
63  CategoryRenderer const&));
64  MOCK_METHOD1(register_category, void(Category::SCPtr category));
65  MOCK_METHOD1(lookup_category, Category::SCPtr(std::string const&));
66  MOCK_METHOD1(push, bool(CategorisedResult const&));
67  MOCK_METHOD2(push, bool(Filters const&, FilterState const&));
68  MOCK_METHOD1(push, bool(experimental::Annotation const& annotation));
69 };
70 
72 
73 } // namespace testing
74 
75 } // namespace scopes
76 
77 } // namespace unity
78 
79 #endif
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:106
Allows the results of a search query to be sent to the query source.
Definition: SearchReply.h:46