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 
0007 #include "invalidfilterinfotest.h"
0008 #include "../filter/invalidfilters/invalidfilterinfo.h"
0009 
0010 #include <QTest>
0011 
0012 InvalidFilterInfoTest::InvalidFilterInfoTest(QObject *parent)
0013     : QObject(parent)
0014 {
0015 }
0016 
0017 InvalidFilterInfoTest::~InvalidFilterInfoTest() = default;
0018 
0019 void InvalidFilterInfoTest::shouldAddEmptyValue()
0020 {
0021     MailCommon::InvalidFilterInfo info;
0022     QVERIFY(info.name().isEmpty());
0023     QVERIFY(info.information().isEmpty());
0024 }
0025 
0026 void InvalidFilterInfoTest::shouldAssignValueFromConstructor()
0027 {
0028     const QString name = QStringLiteral("foo");
0029     const QString information = QStringLiteral("bla");
0030     MailCommon::InvalidFilterInfo info(name, information);
0031     QCOMPARE(info.name(), name);
0032     QCOMPARE(info.information(), information);
0033 }
0034 
0035 void InvalidFilterInfoTest::shouldAssignValue()
0036 {
0037     MailCommon::InvalidFilterInfo info;
0038     const QString name = QStringLiteral("foo");
0039     const QString information = QStringLiteral("bla");
0040     info.setName(name);
0041     info.setInformation(information);
0042     QCOMPARE(info.name(), name);
0043     QCOMPARE(info.information(), information);
0044 }
0045 
0046 void InvalidFilterInfoTest::shouldBeEqual()
0047 {
0048     MailCommon::InvalidFilterInfo info;
0049     const QString name = QStringLiteral("foo");
0050     const QString information = QStringLiteral("bla");
0051     info.setName(name);
0052     info.setInformation(information);
0053     MailCommon::InvalidFilterInfo copyInfo;
0054     copyInfo = info;
0055     QVERIFY(copyInfo == info);
0056 }
0057 
0058 QTEST_MAIN(InvalidFilterInfoTest)
0059 
0060 #include "moc_invalidfilterinfotest.cpp"