File indexing completed on 2024-04-21 03:52:39

0001 /*
0002   This file is part of the kcalcore library.
0003 
0004   SPDX-FileCopyrightText: 2006 Allen Winter <winter@kde.org>
0005 
0006   SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "testcalfilter.h"
0010 #include "calfilter.h"
0011 
0012 #include <QTest>
0013 QTEST_MAIN(CalFilterTest)
0014 
0015 using namespace KCalendarCore;
0016 
0017 void CalFilterTest::testValidity()
0018 {
0019     CalFilter f;
0020     f.setName(QStringLiteral("testfilter"));
0021     QVERIFY(f.name() == QLatin1String("testfilter"));
0022     CalFilter g(QStringLiteral("fredfilter"));
0023     QVERIFY(g.name() == QLatin1String("fredfilter"));
0024     CalFilter f1;
0025     CalFilter f2;
0026     QVERIFY(f1 == f2);
0027 }
0028 
0029 void CalFilterTest::testCats()
0030 {
0031     CalFilter f1;
0032     CalFilter f2;
0033     QStringList cats;
0034     cats << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c");
0035     f1.setCategoryList(cats);
0036     f2.setCategoryList(cats);
0037     QVERIFY(f1.categoryList() == f2.categoryList());
0038 }
0039 
0040 #include "moc_testcalfilter.cpp"