generated from general-packages/pika-pkg-template
a8e7e301c1
Some checks failed
PikaOS Package Build & Release (Canary) (amd64-v3) / build (push) Failing after 12s
61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2014-2022 Laurent Montel <montel@kde.org>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
#include "newmailnotifierattributetest.h"
|
|
#include "newmailnotifierattribute.h"
|
|
#include <QTest>
|
|
|
|
using namespace Akonadi;
|
|
|
|
NewMailNotifierAttributeTest::NewMailNotifierAttributeTest(QObject *parent)
|
|
: QObject(parent)
|
|
{
|
|
}
|
|
|
|
void NewMailNotifierAttributeTest::shouldHaveDefaultValue()
|
|
{
|
|
NewMailNotifierAttribute attr;
|
|
QVERIFY(!attr.ignoreNewMail());
|
|
}
|
|
|
|
void NewMailNotifierAttributeTest::shouldSetIgnoreNotification()
|
|
{
|
|
NewMailNotifierAttribute attr;
|
|
bool ignore = false;
|
|
attr.setIgnoreNewMail(ignore);
|
|
QCOMPARE(attr.ignoreNewMail(), ignore);
|
|
ignore = true;
|
|
attr.setIgnoreNewMail(ignore);
|
|
QCOMPARE(attr.ignoreNewMail(), ignore);
|
|
}
|
|
|
|
void NewMailNotifierAttributeTest::shouldSerializedData()
|
|
{
|
|
NewMailNotifierAttribute attr;
|
|
attr.setIgnoreNewMail(true);
|
|
QByteArray ba = attr.serialized();
|
|
NewMailNotifierAttribute result;
|
|
result.deserialize(ba);
|
|
QVERIFY(attr == result);
|
|
}
|
|
|
|
void NewMailNotifierAttributeTest::shouldCloneAttribute()
|
|
{
|
|
NewMailNotifierAttribute attr;
|
|
attr.setIgnoreNewMail(true);
|
|
NewMailNotifierAttribute *result = attr.clone();
|
|
QVERIFY(attr == *result);
|
|
delete result;
|
|
}
|
|
|
|
void NewMailNotifierAttributeTest::shouldHaveType()
|
|
{
|
|
NewMailNotifierAttribute attr;
|
|
QCOMPARE(attr.type(), QByteArray("newmailnotifierattribute"));
|
|
}
|
|
|
|
QTEST_MAIN(NewMailNotifierAttributeTest)
|