-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <gtest/gtest.h>
-
-#include <iostream>
-#include <memory>
-
-#include "theme/loader/theme_info.h"
-
-using ttm::loader::ThemeInfo;
-
-class ThemeInfoTest : public testing::Test {
- public:
- virtual ~ThemeInfoTest() {}
-
- virtual void SetUp() {
- b_.Add("id", "testid");
- b_.Add("pkgid", "testpkgid");
- b_.Add("uid", "5001");
- b_.Add("version", "1.0");
- b_.Add("tool_version", "1.1");
- b_.Add("title", "Test");
- b_.Add("resolution", "360X360");
- b_.Add("preview", "shared/res/preview.png");
- b_.Add("description", "test");
- }
-
- virtual void TearDown() {
- }
-
- tizen_base::Bundle b_;
-};
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetId) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetId(), "testid");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetPkgid) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetPkgid(), "testpkgid");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetUid) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetUid(), 5001);
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetVersion) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetVersion(), "1.0");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetToolVersion) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetToolVersion(), "1.1");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetTitle) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetTitle(), "Test");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetResolution) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetResolution(), "360X360");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetPreview) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetPreview(), "shared/res/preview.png");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_GetDescription) {
- ThemeInfo info(b_);
-
- EXPECT_EQ(info.GetDescription(), "test");
-}
-
-TEST_F(ThemeInfoTest, ThemeInfo_Serialize) {
- ThemeInfo info(b_);
-
- tizen_base::Bundle b = info.Serialize();
- EXPECT_EQ(b.GetString("id"), "testid");
- EXPECT_EQ(b.GetString("pkgid"), "testpkgid");
- EXPECT_EQ(b.GetString("uid"), "5001");
- EXPECT_EQ(b.GetString("version"), "1.0");
- EXPECT_EQ(b.GetString("tool_version"), "1.1");
- EXPECT_EQ(b.GetString("title"), "Test");
- EXPECT_EQ(b.GetString("resolution"), "360X360");
- EXPECT_EQ(b.GetString("preview"), "shared/res/preview.png");
- EXPECT_EQ(b.GetString("description"), "test");
-}
\ No newline at end of file