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

Add more autotests

parent 22b7e053
......@@ -18,6 +18,9 @@
*/
#include "checkduplicateemailsdialogtest.h"
#include "../checkduplicateemailsdialog.h"
#include <QDialogButtonBox>
#include <QListWidget>
#include <QTest>
CheckDuplicateEmailsDialogTest::CheckDuplicateEmailsDialogTest(QObject *parent)
......@@ -31,4 +34,15 @@ CheckDuplicateEmailsDialogTest::~CheckDuplicateEmailsDialogTest()
}
void CheckDuplicateEmailsDialogTest::shouldHaveDefaultValue()
{
CheckDuplicateEmailsDialog dlg;
QListWidget *mListWidget = dlg.findChild<QListWidget *>(QStringLiteral("listwidget"));
QVERIFY(mListWidget);
QCOMPARE(mListWidget->count(), 0);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
}
QTEST_MAIN(CheckDuplicateEmailsDialogTest)
......@@ -29,6 +29,8 @@ public:
explicit CheckDuplicateEmailsDialogTest(QObject *parent = Q_NULLPTR);
~CheckDuplicateEmailsDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CHECKDUPLICATEEMAILSDIALOGTEST_H
......@@ -40,11 +40,12 @@ CheckDuplicateEmailsDialog::CheckDuplicateEmailsDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &CheckDuplicateEmailsDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &CheckDuplicateEmailsDialog::reject);
mainLayout->addWidget(buttonBox);
readConfig();
}
CheckDuplicateEmailsDialog::~CheckDuplicateEmailsDialog()
{
writeConfig();
}
void CheckDuplicateEmailsDialog::writeConfig()
......
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