12d43be4eSopenharmony_ci/*
22d43be4eSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd.
32d43be4eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
42d43be4eSopenharmony_ci * you may not use this file except in compliance with the License.
52d43be4eSopenharmony_ci * You may obtain a copy of the License at
62d43be4eSopenharmony_ci *
72d43be4eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
82d43be4eSopenharmony_ci *
92d43be4eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
102d43be4eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
112d43be4eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122d43be4eSopenharmony_ci * See the License for the specific language governing permissions and
132d43be4eSopenharmony_ci * limitations under the License.
142d43be4eSopenharmony_ci */
152d43be4eSopenharmony_ci
162d43be4eSopenharmony_ci#ifndef MOCK_NETWORK_SEARCH_H
172d43be4eSopenharmony_ci#define MOCK_NETWORK_SEARCH_H
182d43be4eSopenharmony_ci
192d43be4eSopenharmony_ci#include <gtest/gtest.h>
202d43be4eSopenharmony_ci#include <gmock/gmock.h>
212d43be4eSopenharmony_ci#include "i_network_search.h"
222d43be4eSopenharmony_ci
232d43be4eSopenharmony_cinamespace OHOS {
242d43be4eSopenharmony_cinamespace Telephony {
252d43be4eSopenharmony_ci
262d43be4eSopenharmony_ciclass MockNetworkSearchManager : public INetworkSearch {
272d43be4eSopenharmony_cipublic:
282d43be4eSopenharmony_ci    MockNetworkSearchManager() = default;
292d43be4eSopenharmony_ci    virtual ~MockNetworkSearchManager() = default;
302d43be4eSopenharmony_ci
312d43be4eSopenharmony_ci    MOCK_METHOD0(OnInit, bool());
322d43be4eSopenharmony_ci    MOCK_METHOD1(InitTelExtraModule, int32_t(int32_t slotId));
332d43be4eSopenharmony_ci    MOCK_METHOD2(GetPsRadioTech, int32_t(int32_t slotId, int32_t &psRadioTech));
342d43be4eSopenharmony_ci    MOCK_METHOD2(GetCsRadioTech, int32_t(int32_t slotId, int32_t &csRadioTech));
352d43be4eSopenharmony_ci    MOCK_METHOD1(GetOperatorNumeric, std::u16string(int32_t slotId));
362d43be4eSopenharmony_ci    MOCK_METHOD1(GetResidentNetworkNumeric, std::string(int32_t slotId));
372d43be4eSopenharmony_ci    MOCK_METHOD2(GetOperatorName, int32_t(int32_t slotId, std::u16string &operatorName));
382d43be4eSopenharmony_ci    MOCK_METHOD2(GetNetworkStatus, int32_t(int32_t slotId, sptr<NetworkState> &networkState));
392d43be4eSopenharmony_ci    MOCK_METHOD1(GetRadioState, int32_t(int32_t slotId));
402d43be4eSopenharmony_ci    MOCK_METHOD2(GetRadioState, int32_t(int32_t slotId, NSCALLBACK &callback));
412d43be4eSopenharmony_ci    MOCK_METHOD3(SetRadioState, void(int32_t slotId, bool isOn, int32_t rst));
422d43be4eSopenharmony_ci    MOCK_METHOD4(SetRadioState, int32_t(int32_t slotId, bool isOn, int32_t rst, NSCALLBACK &callback));
432d43be4eSopenharmony_ci    MOCK_METHOD2(GetSignalInfoList, int32_t(int32_t slotId, std::vector<sptr<SignalInformation>> &signals));
442d43be4eSopenharmony_ci    MOCK_METHOD3(RegisterCoreNotify, void(int32_t slotId, HANDLE &handler, int32_t what));
452d43be4eSopenharmony_ci    MOCK_METHOD3(UnRegisterCoreNotify, void(int32_t slotId, HANDLE &handler, int32_t what));
462d43be4eSopenharmony_ci    MOCK_METHOD1(RegisterCellularDataObject, void(const sptr<NetworkSearchCallBackBase> &callback));
472d43be4eSopenharmony_ci    MOCK_METHOD1(UnRegisterCellularDataObject, void(const sptr<NetworkSearchCallBackBase> &callback));
482d43be4eSopenharmony_ci    MOCK_METHOD1(RegisterCellularCallObject, void(const sptr<NetworkSearchCallBackBase> &callback));
492d43be4eSopenharmony_ci    MOCK_METHOD1(UnRegisterCellularCallObject, void(const sptr<NetworkSearchCallBackBase> &callback));
502d43be4eSopenharmony_ci    MOCK_METHOD2(GetNetworkSearchInformation, int32_t(int32_t slotId, NSCALLBACK &callback));
512d43be4eSopenharmony_ci    MOCK_METHOD2(GetNetworkSelectionMode, int32_t(int32_t slotId, NSCALLBACK &callback));
522d43be4eSopenharmony_ci    MOCK_METHOD5(SetNetworkSelectionMode, int32_t(int32_t slotId, int32_t selectMode,
532d43be4eSopenharmony_ci        const sptr<NetworkInformation> &networkInformation, bool resumeSelection, NSCALLBACK &callback));
542d43be4eSopenharmony_ci    MOCK_METHOD2(GetIsoCountryCodeForNetwork, int32_t(int32_t slotId, std::u16string &countryCode));
552d43be4eSopenharmony_ci    MOCK_METHOD2(GetPreferredNetwork, int32_t(int32_t slotId, NSCALLBACK &callback));
562d43be4eSopenharmony_ci    MOCK_METHOD3(SetPreferredNetwork, int32_t(int32_t slotId, int32_t networkMode, NSCALLBACK &callback));
572d43be4eSopenharmony_ci    MOCK_METHOD1(GetPsRegState, int32_t(int32_t slotId));
582d43be4eSopenharmony_ci    MOCK_METHOD1(GetCsRegState, int32_t(int32_t slotId));
592d43be4eSopenharmony_ci    MOCK_METHOD1(GetPsRoamingState, int32_t(int32_t slotId));
602d43be4eSopenharmony_ci    MOCK_METHOD2(GetImei, int32_t(int32_t slotId, std::u16string &imei));
612d43be4eSopenharmony_ci    MOCK_METHOD2(GetImeiSv, int32_t(int32_t slotId, std::u16string &imeiSv));
622d43be4eSopenharmony_ci    MOCK_METHOD3(GetImsRegStatus, int32_t(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo &info));
632d43be4eSopenharmony_ci    MOCK_METHOD2(GetCellInfoList, int32_t(int32_t slotId, std::vector<sptr<CellInformation>> &cellInfo));
642d43be4eSopenharmony_ci    MOCK_METHOD1(SendUpdateCellLocationRequest, int32_t(int32_t slotId));
652d43be4eSopenharmony_ci    MOCK_METHOD1(GetCellLocation, sptr<CellLocation>(int32_t slotId));
662d43be4eSopenharmony_ci    MOCK_METHOD2(GetMeid, int32_t(int32_t slotId, std::u16string &meid));
672d43be4eSopenharmony_ci    MOCK_METHOD2(GetUniqueDeviceId, int32_t(int32_t slotId, std::u16string &deviceId));
682d43be4eSopenharmony_ci    MOCK_METHOD1(GetPhoneType, PhoneType(int32_t slotId));
692d43be4eSopenharmony_ci    MOCK_METHOD3(SetNrOptionMode, int32_t(int32_t slotId, int32_t mode, NSCALLBACK &callback));
702d43be4eSopenharmony_ci    MOCK_METHOD2(GetNrOptionMode, int32_t(int32_t slotId, NrMode &mode));
712d43be4eSopenharmony_ci    MOCK_METHOD2(GetNrOptionMode, int32_t(int32_t slotId, NSCALLBACK &callback));
722d43be4eSopenharmony_ci    MOCK_METHOD1(GetFrequencyType, FrequencyType(int32_t slotId));
732d43be4eSopenharmony_ci    MOCK_METHOD1(GetNrState, NrState(int32_t slotId));
742d43be4eSopenharmony_ci    MOCK_METHOD4(RegisterImsRegInfoCallback, int32_t(int32_t slotId, ImsServiceType imsSrvType, const int32_t tokenId,
752d43be4eSopenharmony_ci        const sptr<ImsRegInfoCallback> &callback));
762d43be4eSopenharmony_ci    MOCK_METHOD3(UnregisterImsRegInfoCallback, int32_t(int32_t slotId, ImsServiceType imsSrvType,
772d43be4eSopenharmony_ci        const int32_t tokenId));
782d43be4eSopenharmony_ci    MOCK_METHOD2(GetBasebandVersion, int32_t(int32_t slotId, std::string &version));
792d43be4eSopenharmony_ci    MOCK_METHOD1(InitAirplaneMode, void(int32_t slotId));
802d43be4eSopenharmony_ci    MOCK_METHOD1(GetAirplaneMode, int32_t(bool &airplaneMode));
812d43be4eSopenharmony_ci    MOCK_METHOD3(GetNetworkCapability, int32_t(int32_t slotId, int32_t networkCapabilityType,
822d43be4eSopenharmony_ci        int32_t &networkCapabilityState));
832d43be4eSopenharmony_ci    MOCK_METHOD3(SetNetworkCapability, int32_t(int32_t slotId, int32_t networkCapabilityType,
842d43be4eSopenharmony_ci        int32_t networkCapabilityState));
852d43be4eSopenharmony_ci    MOCK_METHOD1(UpdateRadioOn, int32_t(int32_t slotId));
862d43be4eSopenharmony_ci    MOCK_METHOD2(GetRrcConnectionState, int32_t(int32_t slotId, int32_t &status));
872d43be4eSopenharmony_ci    MOCK_METHOD1(FactoryReset, int32_t(int32_t slotId));
882d43be4eSopenharmony_ci    MOCK_METHOD2(GetNrSsbId, int32_t(int32_t slotId, const std::shared_ptr<NrSsbInformation> &nrSsbInformation));
892d43be4eSopenharmony_ci    MOCK_METHOD1(IsNrSupported, bool(int32_t slotId));
902d43be4eSopenharmony_ci    MOCK_METHOD0(IsSatelliteEnabled, bool());
912d43be4eSopenharmony_ci    MOCK_METHOD2(DcPhysicalLinkActiveUpdate, void(int32_t slotId, bool isActive));
922d43be4eSopenharmony_ci    MOCK_METHOD2(NotifyCallStatusToNetworkSearch, int32_t(int32_t slotId, int32_t callStatus));
932d43be4eSopenharmony_ci    MOCK_METHOD2(HandleNotifyStateChangeWithDelay, int32_t(int32_t slotId, bool isNeedDelay));
942d43be4eSopenharmony_ci    MOCK_METHOD1(StartRadioOnState, int32_t(int32_t slotId));
952d43be4eSopenharmony_ci    MOCK_METHOD1(StartGetRilSignalIntensity, int32_t(int32_t slotId));
962d43be4eSopenharmony_ci    MOCK_METHOD2(ProcessSignalIntensity, int32_t(int32_t slotId, const struct Rssi &signalIntensity));
972d43be4eSopenharmony_ci    MOCK_METHOD2(IsGsm, int32_t(int32_t slotId, bool &isGsm));
982d43be4eSopenharmony_ci    MOCK_METHOD2(IsCdma, int32_t(int32_t slotId, bool &isCdma));
992d43be4eSopenharmony_ci};
1002d43be4eSopenharmony_ci
1012d43be4eSopenharmony_ci}  // namespace Telephony
1022d43be4eSopenharmony_ci}  // namespace OHOS
1032d43be4eSopenharmony_ci#endif  // MOCK_NETWORK_SEARCH_H