File indexing completed on 2024-12-22 04:46:01

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "notificationhistorydelegatetest.h"
0008 #include "notificationhistory/notificationhistorydelegate.h"
0009 
0010 #include <QTest>
0011 QTEST_MAIN(NotificationHistoryDelegateTest)
0012 
0013 NotificationHistoryDelegateTest::NotificationHistoryDelegateTest(QObject *parent)
0014     : QObject{parent}
0015 {
0016 }
0017 
0018 void NotificationHistoryDelegateTest::shouldCompareAccountInfo()
0019 {
0020     {
0021         NotificationHistoryDelegate::RoomAccount info;
0022         info.accountName = QStringLiteral("bla");
0023         info.channelName = QStringLiteral("bli");
0024 
0025         NotificationHistoryDelegate::RoomAccount info2;
0026         info2.accountName = QStringLiteral("bla");
0027         info2.channelName = QStringLiteral("bli");
0028         QCOMPARE(info, info2);
0029     }
0030 
0031     {
0032         NotificationHistoryDelegate::RoomAccount info;
0033         info.accountName = QStringLiteral("zz");
0034         info.channelName = QStringLiteral("kk");
0035 
0036         NotificationHistoryDelegate::RoomAccount info2;
0037         info2.accountName = QStringLiteral("bla");
0038         info2.channelName = QStringLiteral("bli");
0039         QVERIFY(info != info2);
0040     }
0041 
0042     {
0043         NotificationHistoryDelegate::RoomAccount info;
0044         info.accountName = QStringLiteral("bla");
0045         info.channelName = QStringLiteral("kk");
0046 
0047         NotificationHistoryDelegate::RoomAccount info2;
0048         info2.accountName = QStringLiteral("bla");
0049         info2.channelName = QStringLiteral("bli");
0050         QVERIFY(info != info2);
0051     }
0052     {
0053         NotificationHistoryDelegate::RoomAccount info;
0054         info.accountName = QStringLiteral("ss");
0055         info.channelName = QStringLiteral("bli");
0056 
0057         NotificationHistoryDelegate::RoomAccount info2;
0058         info2.accountName = QStringLiteral("bla");
0059         info2.channelName = QStringLiteral("bli");
0060         QVERIFY(info != info2);
0061     }
0062 
0063     {
0064         NotificationHistoryDelegate::RoomAccount info;
0065 
0066         NotificationHistoryDelegate::RoomAccount info2;
0067         QCOMPARE(info, info2);
0068     }
0069 }
0070 
0071 #include "moc_notificationhistorydelegatetest.cpp"