• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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_SIM_FILE_MANAGER_H
16 #define MOCK_SIM_FILE_MANAGER_H
17 
18 #include <gmock/gmock.h>
19 #include <gtest/gtest.h>
20 #include "event_handler.h"
21 #include "event_runner.h"
22 #include "i_tel_ril_manager.h"
23 #include "sim_file_manager.h"
24 #include <memory>
25 #include <string>
26 
27 namespace OHOS {
28 namespace Telephony {
29 class MockSimFileManager : public SimFileManager {
30 public:
31     using HANDLE = std::shared_ptr<AppExecFwk::EventHandler>;
32 
MockSimFileManager(const EventFwk::CommonEventSubscribeInfo & sp,std::weak_ptr<Telephony::ITelRilManager> telRilManager,std::weak_ptr<Telephony::SimStateManager> state)33     MockSimFileManager(
34         const EventFwk::CommonEventSubscribeInfo &sp,
35         std::weak_ptr<Telephony::ITelRilManager> telRilManager,
36         std::weak_ptr<Telephony::SimStateManager> state)
37         : SimFileManager(sp, telRilManager, state) {}
38 
39     virtual ~MockSimFileManager() = default;
40 
41     MOCK_METHOD0(GetSimOperatorNumeric, std::u16string());
42     MOCK_METHOD0(GetISOCountryCodeForSim, std::u16string());
43     MOCK_METHOD0(GetSimSpn, std::u16string());
44     MOCK_METHOD0(GetSimIccId, std::u16string());
45     // 根据需要mock其他方法
46 };
47 } // namespace Telephony
48 } // namespace OHOS
49 
50 #endif // MOCK_SIM_FILE_MANAGER_H