From 634772c6da51c1d69f804bd45bbedaeb88789cd6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 13 Apr 2016 09:26:16 +0200 Subject: Identity Support --- accounts/maildir/tests/settingstest.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'accounts/maildir/tests') diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp index 07665c24..1967bcfc 100644 --- a/accounts/maildir/tests/settingstest.cpp +++ b/accounts/maildir/tests/settingstest.cpp @@ -26,6 +26,8 @@ private slots: auto smtpServer = QString("smtpserver"); auto smtpUsername = QString("username"); auto smtpPassword = QString("password"); + auto username = QString("username"); + auto emailAddress = QString("emailAddress"); MaildirSettings settings; settings.setAccountIdentifier(accountId); @@ -33,6 +35,8 @@ private slots: settings.setProperty("smtpServer", smtpServer); settings.setProperty("smtpUsername", smtpUsername); settings.setProperty("smtpPassword", smtpPassword); + settings.setProperty("username", username); + settings.setProperty("emailAddress", emailAddress); settings.save(); Sink::Store::fetchAll(Sink::Query()).then>([](const QList &resources) { @@ -46,20 +50,23 @@ private slots: QSignalSpy spy(&readSettings, &MaildirSettings::pathChanged); QSignalSpy spy1(&readSettings, &MaildirSettings::smtpResourceChanged); readSettings.setAccountIdentifier(accountId); - QTRY_VERIFY(spy.count()); - QTRY_VERIFY(spy1.count()); + //Once for clear and once for once for the new setting + QTRY_COMPARE(spy.count(), 2); + QTRY_COMPARE(spy1.count(), 2); QVERIFY(!readSettings.accountIdentifier().isEmpty()); QCOMPARE(readSettings.path().toString(), maildirPath); QCOMPARE(readSettings.property("smtpServer").toString(), smtpServer); QCOMPARE(readSettings.property("smtpUsername").toString(), smtpUsername); QCOMPARE(readSettings.property("smtpPassword").toString(), smtpPassword); + QCOMPARE(readSettings.property("username").toString(), smtpUsername); + QCOMPARE(readSettings.property("emailAddress").toString(), smtpPassword); } { MaildirSettings settings; QSignalSpy spy(&settings, &MaildirSettings::pathChanged); settings.setAccountIdentifier(accountId); - QTRY_VERIFY(spy.count()); + QTRY_COMPARE(spy.count(), 2); settings.remove(); } -- cgit v1.2.3