Пример #1
0
void BlackMilordTests::check_PlainTextEditor_typing()
{
    PlainTextEditor *editor = Gui::plainTextEditor();
    QTest::keyEvent(QTest::Click, editor->asWidget(), Qt::Key_A);
    QVERIFY(editor->toPlainText() == "a");
    QTest::keyEvent(QTest::Click, editor->asWidget(), Qt::Key_B);
    QVERIFY(editor->toPlainText() == "ab");
}
Пример #2
0
void BlackMilordTests::check_PlainTextEditor_setTextgetText()
{
    PlainTextEditor *editor = Gui::plainTextEditor();
    QString testString = "test";
    editor->setPlainText(testString);
    QVERIFY(editor->toPlainText() == testString);
    testString = "test\ntest";
    editor->setPlainText(testString);
    QVERIFY(editor->toPlainText() == testString);
}