Commit 8c57858a authored by Laurent Montel's avatar Laurent Montel 😁

Add more unittest

parent 3eb68ea4
...@@ -63,6 +63,8 @@ add_messagecomposer_test( maintextjobtest.cpp ) ...@@ -63,6 +63,8 @@ add_messagecomposer_test( maintextjobtest.cpp )
add_messagecomposer_test( composertest.cpp ) add_messagecomposer_test( composertest.cpp )
add_messagecomposer_cryptotest( cryptocomposertest.cpp ) add_messagecomposer_cryptotest( cryptocomposertest.cpp )
add_messagecomposer_test( infoparttest.cpp ) add_messagecomposer_test( infoparttest.cpp )
add_messagecomposer_test( textparttest.cpp )
add_messagecomposer_test( globalparttest.cpp )
# Crypto # Crypto
add_messagecomposer_cryptotest( signjobtest.cpp ) add_messagecomposer_cryptotest( signjobtest.cpp )
......
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "globalparttest.h"
#include <qtest_kde.h>
#include <../part/globalpart.h>
GlobalPartTest::GlobalPartTest(QObject *parent)
: QObject(parent)
{
}
GlobalPartTest::~GlobalPartTest()
{
}
void GlobalPartTest::shouldHaveDefaultValue()
{
MessageComposer::GlobalPart globalpart;
QVERIFY(globalpart.isGuiEnabled());
QVERIFY(!globalpart.parentWidgetForGui());
QVERIFY(!globalpart.isFallbackCharsetEnabled());
QVERIFY(!globalpart.is8BitAllowed());
QVERIFY(!globalpart.MDNRequested());
}
QTEST_KDEMAIN(GlobalPartTest, NoGUI)
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GLOBALPARTTEST_H
#define GLOBALPARTTEST_H
#include <QObject>
class GlobalPartTest : public QObject
{
Q_OBJECT
public:
explicit GlobalPartTest(QObject *parent=0);
~GlobalPartTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // GLOBALPARTTEST_H
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "textparttest.h"
#include <qtest_kde.h>
#include <../part/textpart.h>
TextPartTest::TextPartTest(QObject *parent)
: QObject(parent)
{
}
TextPartTest::~TextPartTest()
{
}
void TextPartTest::shouldHaveDefaultValue()
{
MessageComposer::TextPart textpart;
QVERIFY(textpart.warnBadCharset());
QVERIFY(textpart.isWordWrappingEnabled());
}
QTEST_KDEMAIN(TextPartTest, NoGUI)
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef TEXTPARTTEST_H
#define TEXTPARTTEST_H
#include <QObject>
class TextPartTest : public QObject
{
Q_OBJECT
public:
explicit TextPartTest(QObject *parent=0);
~TextPartTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // TEXTPARTTEST_H
Markdown is supported
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