AusweisApp2/test/qt/card/bluetooth/test_BluetoothMessage.cpp

40 lines
870 B
C++
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*!
* \brief Unit tests for \ref BluetoothMessage
*
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2014-2019 Governikus GmbH & Co. KG, Germany
2017-07-03 09:30:10 +02:00
*/
#include "messages/BluetoothMessageStatusInd.h"
#include <QtCore/QtCore>
#include <QtTest/QtTest>
using namespace governikus;
class test_BluetoothMessage
: public QObject
{
Q_OBJECT
private Q_SLOTS:
void statusIndCtor()
{
BluetoothMessageStatusInd msg;
QCOMPARE(msg.getBluetoothMsgId(), BluetoothMsgId::StatusInd);
}
void statusIndStatusChange()
{
2017-07-03 09:33:28 +02:00
BluetoothMessageParameterStatusChange param(QByteArray(1, Enum<BluetoothStatusChange>::getValue(BluetoothStatusChange::CardRecovered)));
2017-07-03 09:30:10 +02:00
BluetoothMessageStatusInd msg;
msg.copyParameter(param);
QCOMPARE(msg.getStatusChange(), BluetoothStatusChange::CardRecovered);
}
};
QTEST_GUILESS_MAIN(test_BluetoothMessage)
#include "test_BluetoothMessage.moc"