• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FMS_MANAGER_PROXY_MOCK_H
17 #define FMS_MANAGER_PROXY_MOCK_H
18 #include <gtest/gtest.h>
19 #include "gmock/gmock.h"
20 #include "iremote_stub.h"
21 #include "iremote_proxy.h"
22 #include "ifms_client.h"
23 
24 namespace OHOS {
25 namespace FileManagerService {
26 class FmsManagerProxyMock : public IRemoteStub<IFileManagerService>, public IFmsClient {
27 public:
28     DECLARE_INTERFACE_DESCRIPTOR(u"FmsManagerProxyMock");
FmsManagerProxyMock()29     FmsManagerProxyMock() {}
~FmsManagerProxyMock()30     virtual ~FmsManagerProxyMock() {}
31     MOCK_METHOD4(SendRequest, int(uint32_t, MessageParcel &, MessageParcel &, MessageOption &));
InvokeSendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)32     int32_t InvokeSendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
33     {
34         return ERR_NONE;
35     }
Mkdir(const std::string & name,const std::string & path)36     virtual int Mkdir(const std::string &name, const std::string &path) override
37     {
38         return ERR_NONE;
39     }
ListFile(const std::string & type,const std::string & path,const CmdOptions & option,std::vector<std::shared_ptr<FileInfo>> & fileRes)40     virtual int ListFile(const std::string &type, const std::string &path, const CmdOptions &option,
41         std::vector<std::shared_ptr<FileInfo>> &fileRes) override
42     {
43         return ERR_NONE;
44     }
GetRoot(const CmdOptions & option,std::vector<std::shared_ptr<FileInfo>> & fileRes)45     virtual int GetRoot(const CmdOptions &option, std::vector<std::shared_ptr<FileInfo>> &fileRes) override
46     {
47         return ERR_NONE;
48     }
CreateFile(const std::string & path,const std::string & fileName,const CmdOptions & option,std::string & uri)49     virtual int CreateFile(const std::string &path, const std::string &fileName,
50         const CmdOptions &option, std::string &uri) override
51     {
52         return ERR_NONE;
53     }
54 };
55 }  // namespace FileManagerService
56 }  // namespace OHOS
57 
58 #endif  // FMS_MANAGER_PROXY_MOCK_H