Commit 34dc6dfc authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent c6f85545
......@@ -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)
......@@ -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
......@@ -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;
}
......@@ -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
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