/*
 *
 * Copyright (C) 2024, KylinSoft Co., Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library.  If not, see <https://www.gnu.org/licenses/>.
 *
 * Authors: Zhenyu Wang <wangzhenyu@kylinos.cn>
 *
 */

#include <QtTest/QtTest>
#include "../../kysdk-thememanager/src/kthememanager.h"

class KThemeManagerTest : public QObject
{
    Q_OBJECT

private slots:
    void testGetUkccGlobalTheme();
    void testGetSupportSystemStyle();
    void testGetSystemThemeColor();
    void testGetSystemFont();
    void testGetSystemFontSize();
    void testSetSystemStyle();
    void testSetSystemFont();
    void testSetSystemFontSize();
    void testSetSystemThemeColor();
    void testSetPanelSpecialEffect();
    void testSetTransparency();

private:
    kdk::KThemeManager themeManager;
};

void KThemeManagerTest::testGetUkccGlobalTheme()
{
    QString theme = themeManager.getUkccGlobalTheme();
    QVERIFY(!theme.isEmpty());
}

void KThemeManagerTest::testGetSupportSystemStyle()
{
    QStringList styles = themeManager.getSupportSystemStyle();
    QVERIFY(!styles.isEmpty());
}

void KThemeManagerTest::testGetSystemThemeColor()
{
    QString color = themeManager.getSystemThemeColor();
    QVERIFY(!color.isEmpty());
}

void KThemeManagerTest::testGetSystemFont()
{
    QString font = themeManager.getSystemFont();
    QVERIFY(!font.isEmpty());
}

void KThemeManagerTest::testGetSystemFontSize()
{
    int fontSize = themeManager.getSystemFontSize();
    QVERIFY(fontSize > 0);
}

void KThemeManagerTest::testSetSystemStyle()
{
    bool success = themeManager.setSystemStyle("ukui-default");
    QVERIFY(success);
}

void KThemeManagerTest::testSetSystemFont()
{
    bool success = themeManager.setSystemFont("Noto Sans CJK SC");
    QVERIFY(success);
}

void KThemeManagerTest::testSetSystemFontSize()
{
    bool success = themeManager.setSystemFontSize(12);
    QVERIFY(success);
}

void KThemeManagerTest::testSetSystemThemeColor()
{
    bool success = themeManager.setSystemThemeColor("daybreakBlue");
    QVERIFY(success);
}

void KThemeManagerTest::testSetPanelSpecialEffect()
{
    bool success = themeManager.setPanelSpecialEffect(true);
    QVERIFY(success);
}

void KThemeManagerTest::testSetTransparency()
{
    bool success = themeManager.setTransparency(0.70);
    QVERIFY(success);
}

QTEST_APPLESS_MAIN(KThemeManagerTest)

#include "thememanagertest.moc"