File indexing completed on 2024-12-22 05:05:24

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "importmailfolderattributejobtest.h"
0008 #include <QSignalSpy>
0009 #include <QTest>
0010 
0011 QTEST_GUILESS_MAIN(ImportMailFolderAttributeJobTest)
0012 
0013 ImportMailFolderAttributeJobTest::ImportMailFolderAttributeJobTest(QObject *parent)
0014     : QObject{parent}
0015 {
0016 }
0017 
0018 void ImportMailFolderAttributeJobTest::shouldHaveDefaultValues()
0019 {
0020     ImportMailFolderAttributeJobImplTest job;
0021     QVERIFY(!job.canStart());
0022 }
0023 
0024 void ImportMailFolderAttributeJobTest::shouldEmitSignal()
0025 {
0026     // Emit signal when we can't start.
0027     ImportMailFolderAttributeJobImplTest job;
0028     QSignalSpy spyFinished(&job, &ImportMailFolderAttributeJobImplTest::failed);
0029     job.start();
0030     QCOMPARE(spyFinished.count(), 1);
0031 }
0032 
0033 #include "moc_importmailfolderattributejobtest.cpp"