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

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "teaminfotest.h"
0008 #include "teams/teaminfo.h"
0009 #include <QTest>
0010 QTEST_GUILESS_MAIN(TeamInfoTest)
0011 TeamInfoTest::TeamInfoTest(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 void TeamInfoTest::shouldHaveDefaultValues()
0017 {
0018     TeamInfo info;
0019     QVERIFY(info.teamId().isEmpty());
0020     QVERIFY(!info.mainTeam());
0021     QVERIFY(!info.autoJoin());
0022     QVERIFY(!info.isValid());
0023     QVERIFY(!info.hasTeamRoom());
0024     QCOMPARE(info.roomsCount(), 0);
0025 }
0026 
0027 void TeamInfoTest::shouldVerifyHasTeamRoom()
0028 {
0029     TeamInfo info;
0030     QVERIFY(!info.hasTeamRoom());
0031     info.setMainTeam(true);
0032     info.setTeamId(QStringLiteral("ff"));
0033     QVERIFY(!info.hasTeamRoom());
0034     info.setMainTeam(false);
0035     QVERIFY(info.hasTeamRoom());
0036     info.setTeamId(QString());
0037     QVERIFY(!info.hasTeamRoom());
0038 }
0039 
0040 #include "moc_teaminfotest.cpp"