generated from general-packages/pika-pkg-template
a8e7e301c1
Some checks failed
PikaOS Package Build & Release (Canary) (amd64-v3) / build (push) Failing after 12s
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2014-2022 Laurent Montel <montel@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-only
|
|
*/
|
|
|
|
#include "mdnstateattributetest.h"
|
|
#include "mdnstateattribute.h"
|
|
#include <QTest>
|
|
|
|
MDNStateAttributeTest::MDNStateAttributeTest(QObject *parent)
|
|
: QObject(parent)
|
|
{
|
|
}
|
|
|
|
MDNStateAttributeTest::~MDNStateAttributeTest() = default;
|
|
|
|
void MDNStateAttributeTest::shouldHaveDefaultValue()
|
|
{
|
|
Akonadi::MDNStateAttribute attr;
|
|
QCOMPARE(attr.mdnState(), Akonadi::MDNStateAttribute::MDNStateUnknown);
|
|
}
|
|
|
|
void MDNStateAttributeTest::shouldHaveType()
|
|
{
|
|
Akonadi::MDNStateAttribute attr;
|
|
QCOMPARE(attr.type(), QByteArray("MDNStateAttribute"));
|
|
}
|
|
|
|
void MDNStateAttributeTest::shouldSerializedAttribute()
|
|
{
|
|
Akonadi::MDNStateAttribute attr;
|
|
|
|
attr.setMDNState(Akonadi::MDNStateAttribute::MDNDenied);
|
|
QCOMPARE(attr.mdnState(), Akonadi::MDNStateAttribute::MDNDenied);
|
|
const QByteArray ba = attr.serialized();
|
|
Akonadi::MDNStateAttribute result;
|
|
result.deserialize(ba);
|
|
QVERIFY(attr == result);
|
|
}
|
|
|
|
void MDNStateAttributeTest::shouldCloneAttribute()
|
|
{
|
|
Akonadi::MDNStateAttribute attr;
|
|
attr.setMDNState(Akonadi::MDNStateAttribute::MDNDenied);
|
|
|
|
Akonadi::MDNStateAttribute *result = attr.clone();
|
|
QVERIFY(attr == *result);
|
|
delete result;
|
|
}
|
|
|
|
QTEST_MAIN(MDNStateAttributeTest)
|