Commit b6477328 authored by Laurent Montel's avatar Laurent Montel
Browse files

Check if element is blocked or not

parent 17e2d2dc
Pipeline #46554 passed with stage
in 48 minutes
...@@ -6,15 +6,39 @@ ...@@ -6,15 +6,39 @@
#include "remotecontentmanagertest.h" #include "remotecontentmanagertest.h"
#include "remote-content/remotecontentmanager.h" #include "remote-content/remotecontentmanager.h"
#include "remote-content/remotecontentinfo.h"
#include <QStandardPaths>
#include <QTest> #include <QTest>
QTEST_MAIN(RemoteContentManagerTest) QTEST_MAIN(RemoteContentManagerTest)
RemoteContentManagerTest::RemoteContentManagerTest(QObject *parent) RemoteContentManagerTest::RemoteContentManagerTest(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
QStandardPaths::setTestModeEnabled(true);
} }
void RemoteContentManagerTest::shouldHaveDefaultValues() void RemoteContentManagerTest::shouldHaveDefaultValues()
{ {
MessageViewer::RemoteContentManager m; MessageViewer::RemoteContentManager m;
QVERIFY(m.removeContentInfo().isEmpty());
}
void RemoteContentManagerTest::shouldIsBlocked_data()
{
QTest::addColumn<QUrl>("url");
QTest::addColumn<bool>("blocked");
QTest::addColumn<bool>("contains");
QTest::newRow("empty") << QUrl() << false << false;
}
void RemoteContentManagerTest::shouldIsBlocked()
{
QFETCH(QUrl, url);
QFETCH(bool, blocked);
QFETCH(bool, contains);
MessageViewer::RemoteContentManager m;
bool isInList = false;
const bool result = m.isAutorized(url, isInList);
QCOMPARE(isInList, contains);
QCOMPARE(blocked, result);
} }
...@@ -18,6 +18,8 @@ public: ...@@ -18,6 +18,8 @@ public:
private Q_SLOTS: private Q_SLOTS:
void shouldHaveDefaultValues(); void shouldHaveDefaultValues();
void shouldIsBlocked_data();
void shouldIsBlocked();
}; };
#endif // REMOTECONTENTMANAGERTEST_H #endif // REMOTECONTENTMANAGERTEST_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment