File indexing completed on 2025-03-09 04:54:37
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #include "remotecontentinfotest.h" 0007 #include "remote-content/remotecontentinfo.h" 0008 #include <QTest> 0009 QTEST_GUILESS_MAIN(RemoteContentInfoTest) 0010 RemoteContentInfoTest::RemoteContentInfoTest(QObject *parent) 0011 : QObject(parent) 0012 { 0013 } 0014 0015 void RemoteContentInfoTest::shouldHaveDefaultValues() 0016 { 0017 MessageViewer::RemoteContentInfo info; 0018 QVERIFY(info.url().isEmpty()); 0019 QCOMPARE(info.status(), MessageViewer::RemoteContentInfo::RemoteContentInfoStatus::Unknown); 0020 QVERIFY(!info.isValid()); 0021 } 0022 0023 void RemoteContentInfoTest::shouldVerifyIsValid() 0024 { 0025 MessageViewer::RemoteContentInfo info; 0026 QCOMPARE(info.status(), MessageViewer::RemoteContentInfo::RemoteContentInfoStatus::Unknown); 0027 QVERIFY(!info.isValid()); 0028 info.setUrl(QStringLiteral("bla")); 0029 QVERIFY(!info.isValid()); 0030 info.setStatus(MessageViewer::RemoteContentInfo::RemoteContentInfoStatus::Blocked); 0031 QVERIFY(info.isValid()); 0032 info.setUrl({}); 0033 QVERIFY(!info.isValid()); 0034 } 0035 0036 #include "moc_remotecontentinfotest.cpp"