/**
 * Copyright (c) 2018-2026 Governikus GmbH & Co. KG, Germany
 */

#include "command/DestroyPaceChannelCommand.h"

#include "MockCardConnectionWorker.h"

#include <QtCore>
#include <QtTest>


using namespace governikus;


class test_DestroyPaceChannelCommand
	: public QObject
{
	Q_OBJECT

	private Q_SLOTS:
		void test_InternalExecute()
		{
			const auto& worker1 = MockCardConnectionWorker::create();
			worker1->addPaceCode(CardReturnCode::OK);
			DestroyPaceChannelCommand command1(worker1, QStringLiteral("slotname"));
			command1.internalExecute();
			QCOMPARE(command1.getReturnCode(), CardReturnCode::OK);

			const auto& worker2 = MockCardConnectionWorker::create();
			worker2->addPaceCode(CardReturnCode::UNKNOWN);
			DestroyPaceChannelCommand command2(worker2, QStringLiteral("slotname"));
			command2.internalExecute();
			QCOMPARE(command2.getReturnCode(), CardReturnCode::UNKNOWN);
		}


};

QTEST_GUILESS_MAIN(test_DestroyPaceChannelCommand)
#include "test_DestroyPaceChannelCommand.moc"
