File indexing completed on 2024-12-01 04:35:23
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "emoticoncategorytest.h" 0008 #include "emoticons/emoticoncategory.h" 0009 #include <QTest> 0010 QTEST_GUILESS_MAIN(EmoticonCategoryTest) 0011 EmoticonCategoryTest::EmoticonCategoryTest(QObject *parent) 0012 : QObject(parent) 0013 { 0014 } 0015 0016 void EmoticonCategoryTest::shouldHaveDefaultValues() 0017 { 0018 EmoticonCategory cat; 0019 QVERIFY(cat.category().isEmpty()); 0020 QVERIFY(cat.name().isEmpty()); 0021 } 0022 0023 void EmoticonCategoryTest::shouldAssignValues() 0024 { 0025 EmoticonCategory cat; 0026 const QString categoryName{QStringLiteral("cat")}; 0027 cat.setCategory(categoryName); 0028 QCOMPARE(cat.category(), categoryName); 0029 0030 const QString name{QStringLiteral("name")}; 0031 cat.setName(name); 0032 QCOMPARE(cat.name(), name); 0033 0034 const QString namei18n{QStringLiteral("i18n")}; 0035 cat.setI18nName(namei18n); 0036 QCOMPARE(cat.i18nName(), namei18n); 0037 } 0038 0039 #include "moc_emoticoncategorytest.cpp"