1 /*
2 * Copyright (c) 2020-2021 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 "themes/theme_manager.h"
17
18 #include <climits>
19 #include <gtest/gtest.h>
20
21 using namespace testing::ext;
22 namespace OHOS {
23 class ThemeManagerTest : public testing::Test {
24 public:
SetUpTestCase(void)25 static void SetUpTestCase(void) {}
TearDownTestCase(void)26 static void TearDownTestCase(void) {}
27 };
28
29 /**
30 * @tc.name: ThemeManagerSetCurrent_001
31 * @tc.desc: Verify SetCurrent function, equal.
32 * @tc.type: FUNC
33 * @tc.require: AR000DTCI5
34 */
HWTEST_F(ThemeManagerTest, ThemeManagerSetCurrent_001, TestSize.Level0)35 HWTEST_F(ThemeManagerTest, ThemeManagerSetCurrent_001, TestSize.Level0)
36 {
37 Theme* theme = new Theme();
38 if (theme == nullptr) {
39 EXPECT_EQ(1, 0);
40 return;
41 }
42 ThemeManager::GetInstance().SetCurrent(theme);
43 EXPECT_EQ(ThemeManager::GetInstance().GetCurrent(), theme);
44
45 delete theme;
46 }
47 } // namespace OHOS
48