Commit e973b828 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent 44dcaa8d
......@@ -42,4 +42,26 @@ void TemplateParserEmailAddressRequesterLineEditTest::shouldHaveDefaultValue()
QVERIFY(mLineEdit->text().isEmpty());
}
void TemplateParserEmailAddressRequesterLineEditTest::shouldAssignValue()
{
TemplateParser::TemplateParserEmailAddressRequesterLineEdit w;
QLineEdit *mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("lineedit"));
const QString str{QStringLiteral("foo")};
w.setText(str);
QCOMPARE(w.text(), str);
QCOMPARE(mLineEdit->text(), str);
}
void TemplateParserEmailAddressRequesterLineEditTest::shouldClearValue()
{
TemplateParser::TemplateParserEmailAddressRequesterLineEdit w;
QLineEdit *mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("lineedit"));
const QString str{QStringLiteral("foo")};
w.setText(str);
QCOMPARE(w.text(), str);
w.clear();
QVERIFY(w.text().isEmpty());
QVERIFY(mLineEdit->text().isEmpty());
}
QTEST_MAIN(TemplateParserEmailAddressRequesterLineEditTest)
......@@ -30,6 +30,8 @@ public:
~TemplateParserEmailAddressRequesterLineEditTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldAssignValue();
void shouldClearValue();
};
#endif // TEMPLATEPARSEREMAILADDRESSREQUESTERLINEEDITTEST_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