File indexing completed on 2024-11-10 04:50:01
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only 0005 */ 0006 #include "filteractionsettransporttest.h" 0007 #include "../filteractions/filteractionsettransport.h" 0008 #include <MailTransport/TransportComboBox> 0009 #include <QTest> 0010 0011 FilterActionSetTransportTest::FilterActionSetTransportTest(QObject *parent) 0012 : QObject(parent) 0013 { 0014 } 0015 0016 FilterActionSetTransportTest::~FilterActionSetTransportTest() = default; 0017 0018 void FilterActionSetTransportTest::shouldBeEmpty() 0019 { 0020 MailCommon::FilterActionSetTransport filter; 0021 QVERIFY(filter.isEmpty()); 0022 } 0023 0024 void FilterActionSetTransportTest::shouldHaveDefaultValue() 0025 { 0026 MailCommon::FilterActionSetTransport filter; 0027 QWidget *w = filter.createParamWidget(nullptr); 0028 QCOMPARE(w->objectName(), QStringLiteral("transportcombobox")); 0029 0030 auto transportCombobox = dynamic_cast<MailTransport::TransportComboBox *>(w); 0031 QVERIFY(transportCombobox); 0032 } 0033 0034 void FilterActionSetTransportTest::shouldHaveRequiredPart() 0035 { 0036 MailCommon::FilterActionSetTransport filter; 0037 QCOMPARE(filter.requiredPart(), MailCommon::SearchRule::CompleteMessage); 0038 } 0039 0040 void FilterActionSetTransportTest::shouldHaveSieveRequires() 0041 { 0042 MailCommon::FilterActionSetTransport filter; 0043 QCOMPARE(filter.sieveRequires(), QStringList()); 0044 } 0045 0046 QTEST_MAIN(FilterActionSetTransportTest) 0047 0048 #include "moc_filteractionsettransporttest.cpp"