Commit 5b2b8d94 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Implement autotest for testing reply to all

parent 30b2a0d6
......@@ -171,6 +171,7 @@ void MessageFactoryTest::testCreateReplyAllWithMultiEmails()
MessageFactory factory(msg, 0);
factory.setIdentityManager(identMan);
factory.setReplyStrategy(ReplyAll);
MessageFactory::MessageReply reply = factory.createReply();
reply.replyAll = true;
......@@ -181,9 +182,25 @@ void MessageFactoryTest::testCreateReplyAllWithMultiEmails()
datetime += QLatin1String(" ") + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString replyStr = QString::fromLatin1(QByteArray(QByteArray("On ") + datetime.toLatin1() + QByteArray(" you wrote:\n> All happy families are alike; each unhappy family is unhappy in its own way.\n\n")));
QCOMPARE(reply.msg->subject()->asUnicodeString(), QLatin1String("Re: Test Email Subject"));
//QCOMPARE_OR_DIFF(reply.msg->body(), replyStr.toLatin1());
//QByteArray ba;
//QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba);
QString userAgent = reply.msg->userAgent()->asUnicodeString();
QString replyTo = reply.msg->inReplyTo()->asUnicodeString();
QString reference = reply.msg->references()->asUnicodeString();
QString dateStr = reply.msg->date()->asUnicodeString();
QString ba = QString::fromLatin1("From: another <another@another.com>\n"
"Date: %1\n"
"User-Agent: %2\n"
"X-KMail-Transport: 0\n"
"Cc: you@you.you, you2@you.you, cc@cc.cc, cc2@cc.cc\n"
"To: me@me.me\n"
"References: %4\n"
"In-Reply-To: %3\n"
"Subject: Re: Test Email Subject\nContent-Type: text/plain; charset=\"US-ASCII\"\n"
"Content-Transfer-Encoding: 8Bit\nMIME-Version: 1.0\n"
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: reply\n\n> All happy families are alike; each unhappy family is unhappy in its own way.")
.arg(dateStr).arg(userAgent).arg(replyTo).arg(reference);
QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba.toLatin1());
delete identMan;
QDir dir(QDir::homePath() + QStringLiteral("/.qttest/"));
dir.removeRecursively();
......
Supports Markdown
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