• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • editor
  • potentialphishingemail
  • autotests
potentialphishingdetailwidgettest.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2015 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 
19 */
20 
21 #include "potentialphishingdetailwidgettest.h"
22 #include "../potentialphishingdetailwidget.h"
23 #include <QLabel>
24 #include <QListWidget>
25 #include <qtest_kde.h>
26 
27 PotentialPhishingDetailWidgetTest::PotentialPhishingDetailWidgetTest(QObject *parent)
28  : QObject(parent)
29 {
30 
31 }
32 
33 PotentialPhishingDetailWidgetTest::~PotentialPhishingDetailWidgetTest()
34 {
35 
36 }
37 
38 void PotentialPhishingDetailWidgetTest::shouldHaveDefaultValue()
39 {
40  PotentialPhishingDetailWidget dlg;
41  QLabel *searchLabel = qFindChild<QLabel *>(&dlg, QLatin1String("label"));
42  QVERIFY(searchLabel);
43 
44  QListWidget *listWidget = qFindChild<QListWidget *>(&dlg, QLatin1String("list_widget"));
45  QVERIFY(listWidget);
46  QCOMPARE(listWidget->count(), 0);
47 }
48 
49 void PotentialPhishingDetailWidgetTest::shouldFillList()
50 {
51  PotentialPhishingDetailWidget dlg;
52  QListWidget *listWidget = qFindChild<QListWidget *>(&dlg, QLatin1String("list_widget"));
53  QStringList lst;
54  lst << QLatin1String("bla");
55  lst << QLatin1String("bli");
56  lst << QLatin1String("blo");
57  dlg.fillList(lst);
58  QCOMPARE(listWidget->count(), lst.count());
59 }
60 
61 void PotentialPhishingDetailWidgetTest::shouldClearListBeforeToAddNew()
62 {
63  PotentialPhishingDetailWidget dlg;
64  QListWidget *listWidget = qFindChild<QListWidget *>(&dlg, QLatin1String("list_widget"));
65  QStringList lst;
66  lst << QLatin1String("bla");
67  lst << QLatin1String("bli");
68  lst << QLatin1String("blo");
69  dlg.fillList(lst);
70  QCOMPARE(listWidget->count(), lst.count());
71  lst.clear();
72  lst << QLatin1String("bla");
73  lst << QLatin1String("bli");
74  dlg.fillList(lst);
75  QCOMPARE(listWidget->count(), lst.count());
76 }
77 
78 void PotentialPhishingDetailWidgetTest::shouldNotAddDuplicateEntries()
79 {
80  PotentialPhishingDetailWidget dlg;
81  QListWidget *listWidget = qFindChild<QListWidget *>(&dlg, QLatin1String("list_widget"));
82  QStringList lst;
83  lst << QLatin1String("bla");
84  lst << QLatin1String("blo");
85  lst << QLatin1String("blo");
86  dlg.fillList(lst);
87  QCOMPARE(listWidget->count(), (lst.count()-1));
88 
89 }
90 
91 QTEST_KDEMAIN(PotentialPhishingDetailWidgetTest, GUI)
QListWidget
QObject
QListWidget::count
count
QStringList
PotentialPhishingDetailWidget
Definition: potentialphishingdetailwidget.h:26
PotentialPhishingDetailWidgetTest::~PotentialPhishingDetailWidgetTest
~PotentialPhishingDetailWidgetTest()
Definition: potentialphishingdetailwidgettest.cpp:33
QLatin1String
PotentialPhishingDetailWidgetTest::PotentialPhishingDetailWidgetTest
PotentialPhishingDetailWidgetTest(QObject *parent=0)
Definition: potentialphishingdetailwidgettest.cpp:27
PotentialPhishingDetailWidgetTest
Definition: potentialphishingdetailwidgettest.h:26
QLabel
potentialphishingdetailwidgettest.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal