File indexing completed on 2024-11-24 04:43:06
0001 /* 0002 This file is part of KAddressBook. 0003 0004 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #include "sendvcardsjobtest.h" 0010 #include "sendvcards/sendvcardsjob.h" 0011 #include <Akonadi/Item> 0012 #include <QTest> 0013 SendVcardsJobTest::SendVcardsJobTest(QObject *parent) 0014 : QObject(parent) 0015 { 0016 } 0017 0018 SendVcardsJobTest::~SendVcardsJobTest() = default; 0019 0020 void SendVcardsJobTest::shouldNotStartWhenListAddressIsEmpty() 0021 { 0022 Akonadi::Item::List lst; 0023 KABSendVCards::SendVcardsJob job(lst); 0024 QVERIFY(!job.start()); 0025 } 0026 0027 void SendVcardsJobTest::shouldHasDefaultValue() 0028 { 0029 Akonadi::Item::List lst; 0030 KABSendVCards::SendVcardsJob job(lst); 0031 QCOMPARE(job.version(), KContacts::VCardConverter::v3_0); 0032 } 0033 0034 void SendVcardsJobTest::shouldChangeExportVersion() 0035 { 0036 Akonadi::Item::List lst; 0037 KABSendVCards::SendVcardsJob job(lst); 0038 job.setVersion(KContacts::VCardConverter::v4_0); 0039 QCOMPARE(job.version(), KContacts::VCardConverter::v4_0); 0040 } 0041 0042 QTEST_MAIN(SendVcardsJobTest) 0043 0044 #include "moc_sendvcardsjobtest.cpp"