1 /*
2  * Copyright (C) 2024-2024 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 #ifndef __MOCK_REMOTE_OBJECT_H__
16 #define __MOCK_REMOTE_OBJECT_H__
17 #include "iremote_object.h"
18 #include "message_parcel.h"
19 
20 namespace OHOS {
21 namespace Telephony {
22 
23 class MockRemoteObject final : public IRemoteObject {
24 public:
MockRemoteObject()25     MockRemoteObject() : IRemoteObject(u"")
26     {
27     }
28     int32_t GetObjectRefCount() override
29     {
30         return retGetObjectRefCount;
31     }
32     int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override
33     {
34         return retSendRequest;
35     }
36     bool AddDeathRecipient(const sptr<DeathRecipient> &recipient) override
37     {
38         return retAddDeathRecipient;
39     }
40     bool RemoveDeathRecipient(const sptr<DeathRecipient> &recipient) override
41     {
42         return retRemoveDeathRecipient;
43     }
44     int Dump(int fd, const std::vector<std::u16string> &args) override
45     {
46         return retDump;
47     }
48 public:
49     int32_t retGetObjectRefCount;
50     int     retSendRequest;
51     bool    retAddDeathRecipient;
52     bool    retRemoveDeathRecipient;
53     int     retDump;
54 };
55 }
56 }
57 #endif