File indexing completed on 2024-12-22 04:45:58

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "messageattachmentdownloadandsavejobtest.h"
0008 #include "misc/messageattachmentdownloadandsavejob.h"
0009 #include <QTest>
0010 QTEST_MAIN(MessageAttachmentDownloadAndSaveJobTest)
0011 
0012 MessageAttachmentDownloadAndSaveJobTest::MessageAttachmentDownloadAndSaveJobTest(QObject *parent)
0013     : QObject{parent}
0014 {
0015 }
0016 
0017 void MessageAttachmentDownloadAndSaveJobTest::shouldHaveDefaultValues()
0018 {
0019     MessageAttachmentDownloadAndSaveJob w;
0020     QVERIFY(!w.rocketChatAccount());
0021     QVERIFY(!w.canStart());
0022     QVERIFY(!w.info().isValid());
0023 }
0024 
0025 void MessageAttachmentDownloadAndSaveJobTest::shouldMessageAttachmentDownloadJobInfoHaveDefaultValues()
0026 {
0027     MessageAttachmentDownloadAndSaveJob::MessageAttachmentDownloadJobInfo info;
0028     QVERIFY(info.attachmentPath.isEmpty());
0029     QVERIFY(!info.needToDownloadAttachment);
0030     QVERIFY(!info.parentWidget);
0031     QVERIFY(!info.isValid());
0032     QCOMPARE(info.attachmentType, MessageAttachmentDownloadAndSaveJob::AttachmentType::Unknown);
0033     QCOMPARE(info.actionType, MessageAttachmentDownloadAndSaveJob::ActionType::Unknown);
0034 }
0035 
0036 #include "moc_messageattachmentdownloadandsavejobtest.cpp"