Unity Scopes API
MockObject.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: Michi Henning <michi.henning@canonical.com>
17  */
18 
19 #pragma once
20 
21 #include <unity/scopes/Object.h>
22 
23 #pragma GCC diagnostic push
24 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
25 #include <gmock/gmock.h>
26 #pragma GCC diagnostic pop
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace testing
35 {
36 
38 
39 class MockObject : public virtual Object
40 {
41 public:
42  MockObject(std::string const& endpoint = "",
43  std::string const& identity = "")
44  : endpoint_(endpoint)
45  , identity_(identity) {}
46 
47  std::string endpoint() override
48  {
49  return endpoint_;
50  }
51  std::string identity() override
52  {
53  return identity_;
54  }
55  MOCK_METHOD0(target_category, std::string());
56  MOCK_METHOD0(timeout, int64_t());
57  MOCK_METHOD0(to_string, std::string());
58 
59 private:
60  std::string const endpoint_;
61  std::string const identity_;
62 };
63 
65 
66 } // namespace testing
67 
68 } // namespace scopes
69 
70 } // namespace unity
Definition: OnlineAccountClient.h:39
Top-level namespace for all things Unity-related.
Definition: Version.h:49
char const * to_string(CompletionDetails::CompletionStatus status)
Convenience function to convert a CompletionDetails::CompletionStatus enumerator to a string...
Definition: CompletionDetails.cpp:95