1 /* 2 * Copyright (c) 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 16 #ifndef COMMON_MOCK_NET_REMOTE_OBJECT_TEST_H 17 #define COMMON_MOCK_NET_REMOTE_OBJECT_TEST_H 18 19 #include "notify_callback_proxy.h" 20 21 namespace OHOS { 22 namespace NetManagerStandard { 23 class MockNetIRemoteObject : public IRemoteObject { 24 public: MockNetIRemoteObject()25 MockNetIRemoteObject() : IRemoteObject(u"mock_i_remote_object") {} ~MockNetIRemoteObject()26 ~MockNetIRemoteObject() {} 27 GetObjectRefCount()28 int32_t GetObjectRefCount() override 29 { 30 return 0; 31 } 32 SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)33 int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override 34 { 35 return 0; 36 } 37 IsProxyObject()38 bool IsProxyObject() const override 39 { 40 return true; 41 } 42 CheckObjectLegality()43 bool CheckObjectLegality() const override 44 { 45 return true; 46 } 47 AddDeathRecipient(const sptr<DeathRecipient> & recipient)48 bool AddDeathRecipient(const sptr<DeathRecipient> &recipient) override 49 { 50 return true; 51 } 52 RemoveDeathRecipient(const sptr<DeathRecipient> & recipient)53 bool RemoveDeathRecipient(const sptr<DeathRecipient> &recipient) override 54 { 55 return true; 56 } 57 Marshalling(Parcel & parcel)58 bool Marshalling(Parcel &parcel) const override 59 { 60 return true; 61 } 62 AsInterface()63 sptr<IRemoteBroker> AsInterface() override 64 { 65 return nullptr; 66 } 67 Dump(int fd,const std::vector<std::u16string> & args)68 int Dump(int fd, const std::vector<std::u16string> &args) override 69 { 70 return 0; 71 } 72 GetObjectDescriptor()73 std::u16string GetObjectDescriptor() const 74 { 75 std::u16string descriptor = std::u16string(); 76 return descriptor; 77 } 78 }; 79 } // namespace NetManagerStandard 80 } // namespace OHOS 81 #endif // COMMON_MOCK_NET_REMOTE_OBJECT_TEST_H 82