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 #define private public 16 #define protected public 17 18 #include <string> 19 #include <unistd.h> 20 #include "telephony_ext_wrapper.h" 21 #include "gtest/gtest.h" 22 #include "csim_file_controller.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 using namespace testing::ext; 27 28 class CsimFileControllerTest : public testing::Test { 29 public: 30 static void SetUpTestCase(); 31 static void TearDownTestCase(); 32 void SetUp(); 33 void TearDown(); 34 }; 35 TearDownTestCase()36void CsimFileControllerTest::TearDownTestCase() {} 37 SetUp()38void CsimFileControllerTest::SetUp() {} 39 TearDown()40void CsimFileControllerTest::TearDown() {} 41 SetUpTestCase()42void CsimFileControllerTest::SetUpTestCase() {} 43 44 /** 45 * @tc.number Telephony_csim_File_Controller_001 46 * @tc.name CsimFileController 47 * @tc.desc Function test 48 */ 49 HWTEST_F(CsimFileControllerTest, Telephony_csim_File_Controller_001, Function | MediumTest | Level1) 50 { 51 int32_t slotId = 0; 52 auto csimFileController = std::make_shared<CsimFileController>(slotId); 53 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_SMS); 54 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CST); 55 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_FDN); 56 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_MSISDN); 57 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_LI); 58 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_MDN); 59 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_IMSIM); 60 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_CDMAHOME); 61 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_EPRL); 62 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_CSIM_MIPUPP); 63 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_IMPU); 64 csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_ICCID); 65 auto ret = csimFileController->ObtainElementFilePath(ELEMENTARY_FILE_RUIM_SPN); 66 auto strs = "3F007FFF"; 67 EXPECT_EQ(ret, strs); 68 } 69 } 70 }