File indexing completed on 2024-12-01 04:35:27

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "roomfilterproxymodeltest.h"
0008 #include "model/roomfilterproxymodel.h"
0009 #include "model/roommodel.h"
0010 #include <QTest>
0011 
0012 QTEST_GUILESS_MAIN(RoomFilterProxyModelTest)
0013 
0014 RoomFilterProxyModelTest::RoomFilterProxyModelTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 void RoomFilterProxyModelTest::shouldHaveDefaultValue()
0020 {
0021     RoomFilterProxyModel w;
0022     QCOMPARE(w.sortColumn(), 0);
0023     QCOMPARE(w.isRecursiveFilteringEnabled(), true);
0024     RoomModel sourceModel;
0025     w.setSourceModel(&sourceModel);
0026     QCOMPARE(w.rowCount(), 0);
0027     QVERIFY(w.sourceModel());
0028     QCOMPARE(w.sourceModel(), &sourceModel);
0029 }
0030 
0031 #include "moc_roomfilterproxymodeltest.cpp"