• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 The Weave Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef LIBWEAVE_INCLUDE_WEAVE_TEST_MOCK_COMMAND_H_
6 #define LIBWEAVE_INCLUDE_WEAVE_TEST_MOCK_COMMAND_H_
7 
8 #include <weave/command.h>
9 
10 #include <memory>
11 #include <string>
12 
13 #include <base/values.h>
14 #include <gmock/gmock.h>
15 
16 namespace weave {
17 namespace test {
18 
19 class MockCommand : public Command {
20  public:
21   ~MockCommand() override = default;
22 
23   MOCK_CONST_METHOD0(GetID, const std::string&());
24   MOCK_CONST_METHOD0(GetName, const std::string&());
25   MOCK_CONST_METHOD0(GetComponent, const std::string&());
26   MOCK_CONST_METHOD0(GetState, Command::State());
27   MOCK_CONST_METHOD0(GetOrigin, Command::Origin());
28   MOCK_CONST_METHOD0(GetParameters, const base::DictionaryValue&());
29   MOCK_CONST_METHOD0(GetProgress, const base::DictionaryValue&());
30   MOCK_CONST_METHOD0(GetResults, const base::DictionaryValue&());
31   MOCK_CONST_METHOD0(GetError, const Error*());
32   MOCK_METHOD2(SetProgress, bool(const base::DictionaryValue&, ErrorPtr*));
33   MOCK_METHOD2(Complete, bool(const base::DictionaryValue&, ErrorPtr*));
34   MOCK_METHOD1(Pause, bool(ErrorPtr*));
35   MOCK_METHOD2(SetError, bool(const Error*, ErrorPtr*));
36   MOCK_METHOD2(Abort, bool(const Error*, ErrorPtr*));
37   MOCK_METHOD1(Cancel, bool(ErrorPtr*));
38 };
39 
40 }  // namespace test
41 }  // namespace weave
42 
43 #endif  // LIBWEAVE_INCLUDE_WEAVE_TEST_MOCK_COMMAND_H_
44