Warning, file /pim/mailcommon/src/search/autotests/searchruletest.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only 0005 */ 0006 0007 #include "searchruletest.h" 0008 #include "../search/searchrule/searchrule.h" 0009 0010 #include <QTest> 0011 0012 class TestSearchRule : public MailCommon::SearchRule 0013 { 0014 public: 0015 TestSearchRule(const QByteArray &field = QByteArray(), Function function = FuncContains, const QString &contents = QString()) 0016 : MailCommon::SearchRule(field, function, contents) 0017 { 0018 } 0019 0020 [[nodiscard]] bool matches(const Akonadi::Item &item) const override 0021 { 0022 Q_UNUSED(item) 0023 return false; 0024 } 0025 0026 [[nodiscard]] bool isEmpty() const override 0027 { 0028 return false; 0029 } 0030 0031 [[nodiscard]] MailCommon::SearchRule::RequiredPart requiredPart() const override 0032 { 0033 return MailCommon::SearchRule::CompleteMessage; 0034 } 0035 }; 0036 0037 SearchRuleTest::SearchRuleTest(QObject *parent) 0038 : QObject(parent) 0039 { 0040 } 0041 0042 void SearchRuleTest::shouldHaveDefaultValue() 0043 { 0044 TestSearchRule searchrule; 0045 QCOMPARE(searchrule.field(), QByteArray()); 0046 QCOMPARE(searchrule.function(), MailCommon::SearchRule::FuncContains); 0047 QVERIFY(searchrule.contents().isEmpty()); 0048 } 0049 0050 void SearchRuleTest::shouldAssignValue() 0051 { 0052 TestSearchRule searchrule; 0053 // TODO 0054 } 0055 0056 QTEST_MAIN(SearchRuleTest) 0057 0058 #include "moc_searchruletest.cpp"