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

mailcommon

  • sources
  • kde-4.14
  • kdepim
  • mailcommon
  • search
  • autotests
searchrulestatustest.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 
19 #include "searchrulestatustest.h"
20 #include "../searchrule/searchrulestatus.h"
21 #include <qtest_kde.h>
22 
23 SearchRuleStatusTest::SearchRuleStatusTest(QObject *parent)
24  : QObject(parent)
25 {
26 
27 }
28 
29 void SearchRuleStatusTest::shouldHaveDefaultValue()
30 {
31  MailCommon::SearchRuleStatus ruleStatus;
32  QVERIFY(ruleStatus.contents().isEmpty());
33  QVERIFY(ruleStatus.field().isEmpty());
34  QCOMPARE(ruleStatus.function(), MailCommon::SearchRule::FuncContains);
35  QVERIFY(ruleStatus.isEmpty());
36 }
37 
38 void SearchRuleStatusTest::shouldHaveRequirePart()
39 {
40  MailCommon::SearchRuleStatus ruleStatus;
41  QCOMPARE(ruleStatus.requiredPart(), MailCommon::SearchRule::Envelope);
42 }
43 
44 void SearchRuleStatusTest::shouldMatchStatus()
45 {
46 
47 }
48 
49 void SearchRuleStatusTest::shouldMatchStatus_data()
50 {
51 
52 }
53 
54 void SearchRuleStatusTest::shouldBeEmpty()
55 {
56  MailCommon::SearchRuleStatus searchrule;
57  QVERIFY(searchrule.isEmpty());
58  searchrule = MailCommon::SearchRuleStatus(QByteArray(), MailCommon::SearchRule::FuncContains, QLatin1String("foo"));
59  QVERIFY(searchrule.isEmpty());
60  searchrule = MailCommon::SearchRuleStatus(QByteArray("<tag>"), MailCommon::SearchRule::FuncContains, QString());
61  QVERIFY(searchrule.isEmpty());
62 
63  searchrule = MailCommon::SearchRuleStatus(QByteArray("<tag>"), MailCommon::SearchRule::FuncContains, QLatin1String("foo"));
64  QVERIFY(!searchrule.isEmpty());
65 }
66 
67 
68 QTEST_KDEMAIN(SearchRuleStatusTest, GUI)
QByteArray
SearchRuleStatusTest
Definition: searchrulestatustest.h:23
QByteArray::isEmpty
bool isEmpty() const
SearchRuleStatusTest::SearchRuleStatusTest
SearchRuleStatusTest(QObject *parent=0)
Definition: searchrulestatustest.cpp:23
MailCommon::SearchRuleStatus::requiredPart
virtual RequiredPart requiredPart() const
Returns the required part from the item that is needed for the search to operate. ...
Definition: searchrulestatus.cpp:134
QObject
MailCommon::SearchRule::contents
QString contents() const
Returns the contents of the rule.
Definition: searchrule.cpp:511
QString::isEmpty
bool isEmpty() const
QString
MailCommon::SearchRule::field
QByteArray field() const
Returns the message header field name (without the trailing ':').
Definition: searchrule.cpp:501
MailCommon::SearchRuleStatus
This class represents a search to be performed against the status of a messsage.
Definition: searchrulestatus.h:85
MailCommon::SearchRule::Envelope
Definition: searchrule.h:80
MailCommon::SearchRule::FuncContains
Definition: searchrule.h:57
MailCommon::SearchRule::function
Function function() const
Returns the filter function of the rule.
Definition: searchrule.cpp:491
searchrulestatustest.h
QLatin1String
MailCommon::SearchRuleStatus::isEmpty
virtual bool isEmpty() const
Determines whether the rule is worth considering.
Definition: searchrulestatus.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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