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

Add minimum autotest for new class

parent ae917962
Pipeline #241894 passed with stage
in 11 minutes and 20 seconds
......@@ -12,6 +12,7 @@ if(BUILD_TESTING)
add_subdirectory( snippet/autotests )
add_subdirectory( mdn/autotests )
add_subdirectory( mdn/tests )
add_subdirectory( contactpreference/autotests)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/part)
......
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: none
macro(add_composerng_autocorrect_unittest _source)
ecm_add_test(${_source}
NAME_PREFIX "messagecomposer-contactpreference-"
LINK_LIBRARIES Qt::Test KF5::MessageComposer
)
endmacro()
add_composerng_autocorrect_unittest(contactpreferencetest.cpp)
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "contactpreferencetest.h"
#include "contactpreference/contactpreference.h"
#include <QTest>
QTEST_GUILESS_MAIN(ContactPreferenceTest)
ContactPreferenceTest::ContactPreferenceTest(QObject *parent)
: QObject{parent}
{
}
void ContactPreferenceTest::shouldHaveDefaultValues()
{
MessageComposer::ContactPreference w;
QCOMPARE(w.cryptoMessageFormat, Kleo::AutoFormat);
QCOMPARE(w.signingPreference, Kleo::UnknownSigningPreference);
QCOMPARE(w.encryptionPreference, Kleo::UnknownPreference);
QVERIFY(w.pgpKeyFingerprints.isEmpty());
QVERIFY(w.smimeCertFingerprints.isEmpty());
}
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
class ContactPreferenceTest : public QObject
{
Q_OBJECT
public:
explicit ContactPreferenceTest(QObject *parent = nullptr);
~ContactPreferenceTest() override = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
Supports Markdown
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