[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim-addons] kmail/editorsendcheckplugins/checkbeforesend: Add more autotest
From: Montel Laurent <montel () kde ! org>
Date: 2016-07-01 5:06:32
Message-ID: E1bIqeu-0002ai-TH () code ! kde ! org
[Download RAW message or body]
Git commit 34dc6dfc54e68e0f87caec01592261f928b2fdd8 by Montel Laurent.
Committed on 01/07/2016 at 05:06.
Pushed by mlaurent into branch 'master'.
Add more autotest
M +20 -0 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp
M +3 -1 kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.h
M +28 -0 kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
M +14 -0 kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.h
http://commits.kde.org/kdepim-addons/34dc6dfc54e68e0f87caec01592261f928b2fdd8
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp \
index a67f4e1..bddf4dd 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp
@@ -18,6 +18,7 @@
*/
#include "checkattachmentjobtest.h"
+#include "../sendattachments/checkattachmentjob.h"
#include <QTest>
@@ -32,4 +33,23 @@ CheckAttachmentJobTest::~CheckAttachmentJobTest()
}
+void CheckAttachmentJobTest::shouldHaveDefaultValue()
+{
+ CheckAttachmentJob job;
+ QVERIFY(job.resultList().isEmpty());
+ QVERIFY(job.originalEmails().isEmpty());
+
+ job.start();
+ QVERIFY(job.resultList().isEmpty());
+ QVERIFY(job.originalEmails().isEmpty());
+}
+
+void CheckAttachmentJobTest::shouldAssignEmails()
+{
+ CheckAttachmentJob job;
+ const QStringList lst{ QStringLiteral("foo"), QStringLiteral("bla") };
+ job.setOriginalEmails(lst);
+ QCOMPARE(job.originalEmails(), lst);
+}
+
QTEST_MAIN(CheckAttachmentJobTest)
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.h \
b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.h \
index a237ae1..0207976 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.h
@@ -28,7 +28,9 @@ class CheckAttachmentJobTest : public QObject
public:
explicit CheckAttachmentJobTest(QObject *parent = Q_NULLPTR);
~CheckAttachmentJobTest();
-
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
+ void shouldAssignEmails();
};
#endif // CHECKATTACHMENTJOBTEST_H
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp \
b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp \
index 30de485..26596b6 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.cpp
@@ -28,3 +28,31 @@ CheckAttachmentJob::~CheckAttachmentJob()
{
}
+
+void CheckAttachmentJob::start()
+{
+ mResultList.clear();
+ Q_FOREACH(const QString &email, mOriginalEmails) {
+
+ }
+}
+
+QStringList CheckAttachmentJob::originalEmails() const
+{
+ return mOriginalEmails;
+}
+
+void CheckAttachmentJob::setOriginalEmails(const QStringList &originalEmails)
+{
+ mOriginalEmails = originalEmails;
+}
+
+QStringList CheckAttachmentJob::resultList() const
+{
+ return mResultList;
+}
+
+void CheckAttachmentJob::setResultList(const QStringList &resultList)
+{
+ mResultList = resultList;
+}
diff --git a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.h \
b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.h \
index 5f957ac..775e87d 100644
--- a/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.h
+++ b/kmail/editorsendcheckplugins/checkbeforesend/sendattachments/checkattachmentjob.h
@@ -20,12 +20,26 @@
#ifndef CHECKATTACHMENTJOB_H
#define CHECKATTACHMENTJOB_H
+#include <QStringList>
class CheckAttachmentJob
{
public:
CheckAttachmentJob();
~CheckAttachmentJob();
+
+ void start();
+
+
+ QStringList originalEmails() const;
+ void setOriginalEmails(const QStringList &originalEmails);
+
+ QStringList resultList() const;
+ void setResultList(const QStringList &resultList);
+
+private:
+ QStringList mOriginalEmails;
+ QStringList mResultList;
};
#endif // CHECKATTACHMENTJOB_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic