• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi/contact

  • akonadi
  • contact
  • editor
  • autotests
emaileditdialogtest.cpp
1/*
2 Copyright (c) 2015 Laurent Montel <montel@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public 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
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#include "emaileditdialogtest.h"
21#include "../emaileditwidget.h"
22#include "kabc/email.h"
23#include <qtest_kde.h>
24#include <KListWidget>
25#include <qpushbutton.h>
26EmailEditDialogTest::EmailEditDialogTest(QObject *parent)
27 : QObject(parent)
28{
29
30}
31
32EmailEditDialogTest::~EmailEditDialogTest()
33{
34
35}
36
37void EmailEditDialogTest::shouldHaveDefaultValue()
38{
39 EmailEditDialog dlg;
40 KListWidget *listwidget = qFindChild<KListWidget *>(&dlg, QLatin1String("emailListBox"));
41 QVERIFY(listwidget);
42 QCOMPARE(listwidget->count(), 0);
43
44 QPushButton *button = qFindChild<QPushButton *>(&dlg, QLatin1String("add"));
45 QVERIFY(button);
46 button = qFindChild<QPushButton *>(&dlg, QLatin1String("remove"));
47 QVERIFY(button);
48 button = qFindChild<QPushButton *>(&dlg, QLatin1String("edit"));
49 QVERIFY(button);
50 button = qFindChild<QPushButton *>(&dlg, QLatin1String("standard"));
51 QVERIFY(button);
52}
53
54void EmailEditDialogTest::shouldAddItems()
55{
56 EmailEditDialog dlg;
57 KListWidget *listwidget = qFindChild<KListWidget *>(&dlg, QLatin1String("emailListBox"));
58 KABC::Email::List lst;
59 lst << KABC::Email(QLatin1String("foo"));
60 lst << KABC::Email(QLatin1String("bla"));
61 lst << KABC::Email(QLatin1String("bli"));
62 dlg.setEmailList(lst);
63 QCOMPARE(listwidget->count(), lst.count());
64}
65
66void EmailEditDialogTest::shouldDontAddTwiceItem()
67{
68 EmailEditDialog dlg;
69 KListWidget *listwidget = qFindChild<KListWidget *>(&dlg, QLatin1String("emailListBox"));
70 KABC::Email::List lst;
71 lst << KABC::Email(QLatin1String("foo"));
72 lst << KABC::Email(QLatin1String("bla"));
73 lst << KABC::Email(QLatin1String("bli"));
74 lst << KABC::Email(QLatin1String("bli"));
75 dlg.setEmailList(lst);
76 QCOMPARE(listwidget->count(), (lst.count()-1));
77}
78
79QTEST_KDEMAIN(EmailEditDialogTest, GUI)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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