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 16 #include "os_accounts_manager_test.h" 17 18 #include "os_accounts_manager.h" 19 20 #include "iam_logger.h" 21 #include "securec.h" 22 23 #define LOG_TAG "USER_AUTH_SA" 24 25 namespace OHOS { 26 namespace UserIam { 27 namespace UserAuth { 28 using namespace testing; 29 using namespace testing::ext; 30 SetUpTestCase()31void OsAccountsManagerTest::SetUpTestCase() 32 { 33 } 34 TearDownTestCase()35void OsAccountsManagerTest::TearDownTestCase() 36 { 37 } 38 SetUp()39void OsAccountsManagerTest::SetUp() 40 { 41 } 42 TearDown()43void OsAccountsManagerTest::TearDown() 44 { 45 } 46 47 HWTEST_F(OsAccountsManagerTest, OnOsAccountSaAddRemoveTest, TestSize.Level0) 48 { 49 EXPECT_NO_THROW(OsAccountsManager::Instance().OnOsAccountSaAdd()); 50 EXPECT_NO_THROW(OsAccountsManager::Instance().OnOsAccountSaAdd()); 51 EXPECT_NO_THROW(OsAccountsManager::Instance().OnOsAccountSaRemove()); 52 EXPECT_NO_THROW(OsAccountsManager::Instance().OnOsAccountSaRemove()); 53 } 54 55 HWTEST_F(OsAccountsManagerTest, StartSubscribeTest, TestSize.Level0) 56 { 57 EXPECT_NO_THROW(OsAccountsManager::Instance().StartSubscribe()); 58 EXPECT_NO_THROW(OsAccountsManager::Instance().StartSubscribe()); 59 } 60 } // namespace UserAuth 61 } // namespace UserIam 62 } // namespace OHOS