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 #include <gmock/gmock.h>
24 
25 namespace unity
26 {
27 
28 namespace scopes
29 {
30 
31 namespace testing
32 {
33 
35 
36 class MockObject : public virtual Object
37 {
38 public:
39  MockObject(std::string const& endpoint = "",
40  std::string const& identity = "")
41  : endpoint_(endpoint)
42  , identity_(identity) {}
43 
44  std::string endpoint() override
45  {
46  return endpoint_;
47  }
48  std::string identity() override
49  {
50  return identity_;
51  }
52  MOCK_METHOD0(target_category, std::string());
53  MOCK_METHOD0(timeout, int64_t());
54  MOCK_METHOD0(to_string, std::string());
55 
56 private:
57  std::string const endpoint_;
58  std::string const identity_;
59 };
60 
62 
63 } // namespace testing
64 
65 } // namespace scopes
66 
67 } // namespace unity
Definition: OnlineAccountClient.h:39
char const * to_string(CompletionDetails::CompletionStatus status)
Convenience function to convert a CompletionDetails::CompletionStatus enumerator to a string...
Definition: CompletionDetails.cpp:95
Top-level namespace for all things Unity-related.
Definition: Version.h:49