summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-28 07:35:15 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-28 07:35:15 (GMT)
commit16cb2f107e5cf2acf0711ca9b4279bc846de904b (patch)
tree8b8d8d0c5a4ee1a72f97947ba583141c0b8d7ab7
parent3c5e28c88cfceffb3cafb94258d3898310dec3c2 (diff)
Add more autotest
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp19
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h1
2 files changed, 16 insertions, 4 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index 5a6a156..4e99223 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -42,20 +42,31 @@ void RichTextComposerNgTest::shouldHaveDefaultValue()
QVERIFY(!richtextComposerNg.autocorrection());
}
+
+void RichTextComposerNgTest::shouldForceAutoCorrection_data()
+{
+ QTest::addColumn<QString>("original");
+ QTest::addColumn<QString>("expected");
+ //FIXME first char !
+ QTest::newRow("test1") << QStringLiteral("boo bla bli. foo faa") << QStringLiteral("boo bla bli. Foo faa");
+
+}
+
void RichTextComposerNgTest::shouldForceAutoCorrection()
{
+ QFETCH(QString, original);
+ QFETCH(QString, expected);
+
MessageComposer::RichTextComposerNg richtextComposerNg;
- richtextComposerNg.setPlainText(QStringLiteral("boo bla bli. foo faa"));
+ richtextComposerNg.setPlainText(original);
PimCommon::AutoCorrection autocorrection;
autocorrection.setEnabledAutoCorrection(true);
autocorrection.setUppercaseFirstCharOfSentence(true);
richtextComposerNg.setAutocorrection(&autocorrection);
richtextComposerNg.forceAutoCorrection(false);
- //FIXME first char !
- QCOMPARE(richtextComposerNg.toPlainText(), QStringLiteral("boo bla bli. Foo faa"));
-//TODO
+ QCOMPARE(richtextComposerNg.toPlainText(), expected);
}
QTEST_MAIN(RichTextComposerNgTest)
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
index 0ea7d37..8b66436 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
@@ -31,6 +31,7 @@ public:
~RichTextComposerNgTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
+ void shouldForceAutoCorrection_data();
void shouldForceAutoCorrection();
};