1 /*
2 * Copyright (c) 2023 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 MOCK_I_CLOUD_SYNC_CALLBACK_H
17 #define MOCK_I_CLOUD_SYNC_CALLBACK_H
18 
19 
20 #include <gmock/gmock.h>
21 
22 #include "i_cloud_sync_callback.h"
23 #include "iremote_stub.h"
24 #include "dfs_error.h"
25 
26 namespace OHOS::FileManagement::CloudSync {
27 
28 class CloudSyncCallbackMock : public IRemoteStub<ICloudSyncCallback> {
29 public:
30     int code_;
CloudSyncCallbackMock()31     CloudSyncCallbackMock() : code_(0) {}
~CloudSyncCallbackMock()32     virtual ~CloudSyncCallbackMock() {}
33 
34     MOCK_METHOD4(SendRequest, int(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
35 
InvokeSendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)36     int32_t InvokeSendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
37     {
38         code_ = code;
39         return E_OK;
40     }
41 
OnSyncStateChanged(CloudSyncState state,ErrorType error)42     void OnSyncStateChanged(CloudSyncState state, ErrorType error) override {}
43 };
44 
45 } // namespace OHOS::FileManagement::CloudSync
46 
47 #endif // MOCK_I_CLOUD_SYNC_CALLBACK_H
48