Commit 44dcaa8d authored by Laurent Montel's avatar Laurent Montel 😁

implement autotest

parent a5d81897
......@@ -33,3 +33,4 @@ add_templateparser_unittest(templatewebengineviewtest.cpp)
add_templateparser_unittest(templateextracthtmlelementwebengineviewtest.cpp)
add_templateparser_unittest(templateparserjobtest.cpp)
add_templateparser_unittest(templateparserextracthtmlinfotest.cpp)
add_templateparser_unittest(templateparseremailaddressrequesterlineedittest.cpp)
/*
Copyright (C) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "templateparseremailaddressrequesterlineedittest.h"
#include "templateparseremailaddressrequesterlineedit.h"
#include <QTest>
#include <QHBoxLayout>
#include <QLineEdit>
TemplateParserEmailAddressRequesterLineEditTest::TemplateParserEmailAddressRequesterLineEditTest(QObject *parent)
: QObject(parent)
{
}
void TemplateParserEmailAddressRequesterLineEditTest::shouldHaveDefaultValue()
{
TemplateParser::TemplateParserEmailAddressRequesterLineEdit w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
QLineEdit *mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("lineedit"));
QVERIFY(mLineEdit);
QVERIFY(mLineEdit->text().isEmpty());
}
QTEST_MAIN(TemplateParserEmailAddressRequesterLineEditTest)
/*
Copyright (C) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef TEMPLATEPARSEREMAILADDRESSREQUESTERLINEEDITTEST_H
#define TEMPLATEPARSEREMAILADDRESSREQUESTERLINEEDITTEST_H
#include <QObject>
class TemplateParserEmailAddressRequesterLineEditTest : public QObject
{
Q_OBJECT
public:
explicit TemplateParserEmailAddressRequesterLineEditTest(QObject *parent = nullptr);
~TemplateParserEmailAddressRequesterLineEditTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // TEMPLATEPARSEREMAILADDRESSREQUESTERLINEEDITTEST_H
......@@ -21,10 +21,10 @@
#define TEMPLATEPARSEREMAILADDRESSREQUESTERLINEEDIT_H
#include <TemplateParser/TemplateParserEmailAddressRequesterBase>
#include "templateparser_private_export.h"
class QLineEdit;
namespace TemplateParser {
class TemplateParserEmailAddressRequesterLineEdit : public TemplateParser::TemplateParserEmailAddressRequesterBase
class TEMPLATEPARSER_TESTS_EXPORT TemplateParserEmailAddressRequesterLineEdit : public TemplateParser::TemplateParserEmailAddressRequesterBase
{
Q_OBJECT
public:
......
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