Commit e7679289 authored by Laurent Montel's avatar Laurent Montel 😁

Remove unused code

parent 04d75473
/*
Copyright (C) 2015-2016 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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "gravatarcreatedialogtest.h"
#include "../widgets/gravatarcreatedialog.h"
#include "../widgets/gravatarcreatewidget.h"
#include <QDialogButtonBox>
#include <qtest.h>
GravatarCreateDialogTest::GravatarCreateDialogTest(QObject *parent)
: QObject(parent)
{
}
GravatarCreateDialogTest::~GravatarCreateDialogTest()
{
}
void GravatarCreateDialogTest::shouldHaveDefaultValue()
{
KABGravatar::GravatarCreateDialog dlg;
KABGravatar::GravatarCreateWidget *w = dlg.findChild<KABGravatar::GravatarCreateWidget *>(QStringLiteral("gravatarcreatewidget"));
QVERIFY(w);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
}
QTEST_MAIN(GravatarCreateDialogTest)
/*
Copyright (C) 2015-2016 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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef GRAVATARCREATEDIALOGTEST_H
#define GRAVATARCREATEDIALOGTEST_H
#include <QObject>
class GravatarCreateDialogTest : public QObject
{
Q_OBJECT
public:
explicit GravatarCreateDialogTest(QObject *parent = Q_NULLPTR);
~GravatarCreateDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // GRAVATARCREATEDIALOGTEST_H
/*
This file is part of KAddressBook.
Copyright (c) 2015 Laurent Montel <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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 "gravatarcreatejobtest.h"
#include <qtest.h>
#include "../job/gravatarcreatejob.h"
GravatarCreateJobTest::GravatarCreateJobTest(QObject *parent)
: QObject(parent)
{
}
GravatarCreateJobTest::~GravatarCreateJobTest()
{
}
void GravatarCreateJobTest::shouldHaveDefaultValue()
{
KABGravatar::GravatarCreateJob job;
QVERIFY(job.email().isEmpty());
}
QTEST_MAIN(GravatarCreateJobTest)
/*
This file is part of KAddressBook.
Copyright (c) 2015 Laurent Montel <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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 GRAVATARCREATEJOBTEST_H
#define GRAVATARCREATEJOBTEST_H
#include <QObject>
class GravatarCreateJobTest : public QObject
{
Q_OBJECT
public:
explicit GravatarCreateJobTest(QObject *parent = Q_NULLPTR);
~GravatarCreateJobTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // GRAVATARCREATEJOBTEST_H
/*
Copyright (C) 2015-2016 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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "gravatarcreatewidgettest.h"
#include <qtest.h>
#include "../widgets/gravatarcreatewidget.h"
#include <QLabel>
#include <QPushButton>
GravatarCreateWidgetTest::GravatarCreateWidgetTest(QObject *parent)
: QObject(parent)
{
}
GravatarCreateWidgetTest::~GravatarCreateWidgetTest()
{
}
void GravatarCreateWidgetTest::shouldHaveDefaultValue()
{
KABGravatar::GravatarCreateWidget widget;
QLabel *lab = widget.findChild<QLabel *>(QStringLiteral("emaillabel"));
QVERIFY(lab);
QLabel *emaillabel = widget.findChild<QLabel *>(QStringLiteral("email"));
QVERIFY(emaillabel);
QPushButton *searchGravatar = widget.findChild<QPushButton *>(QStringLiteral("search"));
QVERIFY(searchGravatar);
QLabel *resultGravatar = widget.findChild<QLabel *>(QStringLiteral("result"));
QVERIFY(resultGravatar);
}
void GravatarCreateWidgetTest::shouldEnableDisableSearchButton()
{
KABGravatar::GravatarCreateWidget widget;
QPushButton *searchGravatar = widget.findChild<QPushButton *>(QStringLiteral("search"));
QVERIFY(!searchGravatar->isEnabled());
widget.setEmail(QStringLiteral("foo"));
QVERIFY(searchGravatar->isEnabled());
widget.setEmail(QString());
QVERIFY(!searchGravatar->isEnabled());
widget.setEmail(QStringLiteral("s"));
QVERIFY(searchGravatar->isEnabled());
widget.setEmail(QStringLiteral(" "));
QVERIFY(!searchGravatar->isEnabled());
}
QTEST_MAIN(GravatarCreateWidgetTest)
/*
Copyright (C) 2015-2016 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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef GRAVATARCREATEWIDGETTEST_H
#define GRAVATARCREATEWIDGETTEST_H
#include <QObject>
class GravatarCreateWidgetTest : public QObject
{
Q_OBJECT
public:
explicit GravatarCreateWidgetTest(QObject *parent = Q_NULLPTR);
~GravatarCreateWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldEnableDisableSearchButton();
};
#endif // GRAVATARCREATEWIDGETTEST_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