2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <gtest/gtest.h>
23 #include "theme/loader/theme_info.h"
25 using ttm::loader::ThemeInfo;
27 class ThemeInfoTest : public testing::Test {
29 virtual ~ThemeInfoTest() {}
31 virtual void SetUp() {
32 b_.Add("id", "testid");
33 b_.Add("pkgid", "testpkgid");
34 b_.Add("uid", "5001");
35 b_.Add("version", "1.0");
36 b_.Add("tool_version", "1.1");
37 b_.Add("title", "Test");
38 b_.Add("resolution", "360X360");
39 b_.Add("preview", "shared/res/preview.png");
40 b_.Add("description", "test");
43 virtual void TearDown() {
46 tizen_base::Bundle b_;
49 TEST_F(ThemeInfoTest, ThemeInfo_GetId) {
52 EXPECT_EQ(info.GetId(), "testid");
55 TEST_F(ThemeInfoTest, ThemeInfo_GetPkgid) {
58 EXPECT_EQ(info.GetPkgid(), "testpkgid");
61 TEST_F(ThemeInfoTest, ThemeInfo_GetUid) {
64 EXPECT_EQ(info.GetUid(), 5001);
67 TEST_F(ThemeInfoTest, ThemeInfo_GetVersion) {
70 EXPECT_EQ(info.GetVersion(), "1.0");
73 TEST_F(ThemeInfoTest, ThemeInfo_GetToolVersion) {
76 EXPECT_EQ(info.GetToolVersion(), "1.1");
79 TEST_F(ThemeInfoTest, ThemeInfo_GetTitle) {
82 EXPECT_EQ(info.GetTitle(), "Test");
85 TEST_F(ThemeInfoTest, ThemeInfo_GetResolution) {
88 EXPECT_EQ(info.GetResolution(), "360X360");
91 TEST_F(ThemeInfoTest, ThemeInfo_GetPreview) {
94 EXPECT_EQ(info.GetPreview(), "shared/res/preview.png");
97 TEST_F(ThemeInfoTest, ThemeInfo_GetDescription) {
100 EXPECT_EQ(info.GetDescription(), "test");
103 TEST_F(ThemeInfoTest, ThemeInfo_Serialize) {
106 tizen_base::Bundle b = info.Serialize();
107 EXPECT_EQ(b.GetString("id"), "testid");
108 EXPECT_EQ(b.GetString("pkgid"), "testpkgid");
109 EXPECT_EQ(b.GetString("uid"), "5001");
110 EXPECT_EQ(b.GetString("version"), "1.0");
111 EXPECT_EQ(b.GetString("tool_version"), "1.1");
112 EXPECT_EQ(b.GetString("title"), "Test");
113 EXPECT_EQ(b.GetString("resolution"), "360X360");
114 EXPECT_EQ(b.GetString("preview"), "shared/res/preview.png");
115 EXPECT_EQ(b.GetString("description"), "test");